It looks like you are using MFC. It already has the DllMain access point needed to properly initialize the MFC. Check out the KB article for recommended workarounds. It is difficult to provide a better answer otherwise, you have not provided a link, and it seems to me that this is Apple code, very non-mfc-ish.
source
share