Software Archive
Read-only legacy content

DllMain

Intel_C_Intel
Employee
723 Views
In contrast to VC, CVF doesn't generate an explicit DllMain but one is provided when the DLL is loaded. You can provide your own for various reasons. What puzzles me is that one must do a !DEC$ ATTRIBUTES DLLEXPORT::DllMain in order for it to take precedence over the default do-nothing DllMain. This makes your custom DllMain public to all and sundry. In VC, the default DllMain can be embellished as required but it remains private to the thread,ie, it doesn't have to have an exported entry point. Why this difference between CVF and VC? I'd prefer that a CVF DllMain remain private.

Ciao,
Gerry T.
0 Kudos
1 Reply
Intel_C_Intel
Employee
723 Views
I was wrong in claiming that !DEC$ ATTRIBUTES DLLEXPORT::DllMain was required. It is not. All that's required is !DEC$ ATTRIBUTES STDCALL, ALIAS : '_DllMain@12' :: DllMain. So CVF maintains the privacy of DllMain to the thread without exporting it. Sorry for my confusion.

Ciao,
Gerry T.
0 Kudos
Reply