Re: Creating DLL Entry Point

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



FFrozTT <tech@xxxxxxxxxxxxxxxx> wrote:
I have a small project that works fine as an EXE. Now I want to make
it into a DLL. I've created a DllMain routine and set it as the
entry
point (code below). Then from DllMain I try to initialize my main
routine called ThreadProc. I've tryed this several different ways
and
can't get it to work. It compiles fine but when I go rundll32
mydll.dll nothing happenes (works in exe form.)

You pass incorrect parameters to rundll32. I suspect it fails before
even loading your DLL.

If you insist on using rundll32, see

http://support.microsoft.com/kb/164787

You need to implement and export a function with a particular signature,
and do all your work there. Creating a new thread is rather pointless -
rundll32 will unload the DLL and terminate as soon as your entry point
returns.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


.



Relevant Pages

  • Re: Creating DLL Entry Point
    ... I've created a DllMain routine and set it as the entry ... RunDll32 is likely not even loading your DLL. ...
    (microsoft.public.vc.language)
  • Re: Firefox and Sound
    ... number of loads that app performed. ... only references to entry points in the dll. ... specified entry points in it can't be found, ... but the download manager said it was only 78.8 MB. ...
    (comp.os.os2.apps)
  • Re: C coding guidelines
    ... /your/ code's entry point, then it isn't what we're talking about - ... but I'm talking specifically about Win32 GUI. ... The REAL entry point for a Win32 GUI program is WinMainCRTStartup. ... link with to produce the DLL. ...
    (comp.lang.c)
  • Run a dll as an app
    ... >My son uses windows xp and zone alarm free firewall ... >the program control information of zone alarm. ... >As this seems to be a legitimate DLL within ... RUNDLL and RUNDLL32 do not normally appear in the Task ...
    (microsoft.public.windowsxp.general)
  • Re: C coding guidelines
    ... ALL dlls will be called BY THE LOADER before the program starts. ... This call will be done to a special entry point called DllMain ... For instance, in the dll you sent me, the header ...
    (comp.lang.c)