Board index » Visual Studio » Dll Entry Point Name

Dll Entry Point Name

Visual Studio287
Hi,



MSDN documentation states:



"The name DllMain is a placeholder for a user-defined function. You

must specify the actual name you use when you build your DLL."



How do you actually accomplish that? I have not been able to find that

in the VC.Net documantation.



Many thanks,



Aaron Fude


-
 

Re:Dll Entry Point Name

<aaronfude@gmail.com>wrote in message

Quote
Hi,



MSDN documentation states:



"The name DllMain is a placeholder for a user-defined function. You

must specify the actual name you use when you build your DLL."



How do you actually accomplish that? I have not been able to find that

in the VC.Net documantation.



http://msdn.microsoft.com/library/default.asp?url" rel="nofollow" target="_blank">msdn.microsoft.com/library/default.asp=/library/en-us/vccore/html/_core_.2f.entry.asp

--

Jeff Partch [VC++ MVP]





-

Re:Dll Entry Point Name

<aaronfude@gmail.com>wrote in message

Quote
MSDN documentation states:



"The name DllMain is a placeholder for a user-defined function. You

must specify the actual name you use when you build your DLL."



How do you actually accomplish that? I have not been able to find that

in the VC.Net documantation.



Short answer: Use the /ENTRY linker option



Longer answer: You don't want to do that



Comprehensive answer: See here



http://msdn.microsoft.com/library/default.asp?url" rel="nofollow" target="_blank">msdn.microsoft.com/library/default.asp=/library/en-us/vccore/html/_core_Run.2d.Time_Library_Behavior.asp



To make a long story short, the operating system doesn't care a whit about

the name of the function. But when using VC++, _it_ sets the entry point at

its own runtime's initialization. That done, it calls your initializer.



Maybe it would be nice if it let you choose the name you like, but it

doesn't. Just it has been carved in stone that there must be main() or

WinMain() ...



Regards,

Will





-