Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CRT Initialization Failure

Status
Not open for further replies.

DirectAnim

Programmer
Apr 30, 2006
2
US
Hello everyone.

I have a managed executable and an unmanged library combination, and I've spent the past couple of hours trying to track down a bug in the system. Finally, I think I may have discovered what it is.

I have some global variables in my static library, and it would appear that when the global variables are being initialized, the CRT itself is in fact not initialized. I'm trying to figure out what's going wrong with it, but I'm not having much luck.

All I have is a global instance of a particular class. The __onexitbegin and __onexitend global pointers are NULL when the call to "_onexit" is made by the global variable construction code. As __onexitbegin and __onexitend are globals and therefore defined in segment space, it explains the reason that they're null-initialized. It's for this reason that I've come to the conclusion that the CRT for that context must not be initialized.

Any ideas? Should I just move the entire thing to a dynamic linking library? That's really something I wanted to avoid if possible.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top