Guys just a quick note: DllMain is an optional proc. If your dll doesn't need to do anything on process/thread attach/detach you aren't required to export it. [strike]The Windows loader checks if its been exported, and if not doesn't call it.[/strike]MSVC will generate it for you.
Edit:
MSDN seems to be giving conflicting advice:
http://msdn.microsoft.com/en-us/l...esktop/ms682583%28v=vs.85%29.aspx
indicates its an optional entry point, while the link @Siegward posted says its generated for you which suggests that its needed.