Re: Creating DLL Entry Point
- From: "Scott Seligman" <seligman@xxxxxxxxxxx>
- Date: 5 Sep 2007 17:35:00 -0700
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.)
A few problems:
It's generally not a good idea to call CreateThread in your DllMain You.
do mention you're handling the problems this will raise elsewhere .
RunDll32 is likely not even loading your DLL. Your using incorrect
syntax, as RunDll32 expects an exported function that it can call.
Even if RunDll32 was loading your DLL, it's extremely likely the
RunDll32 process would exit long before your spawned thread could do
anything remotely interesting.
If you want to test your DLL, it's probably best to write a simple test
app that will call LoadLibrary, and then either wait for you to close
it, or waits some specified time.
--
--------- Scott Seligman <scott at <firstname> and michelle dot net> ---------
They who would give up an essential liberty for temporary security,
deserve neither liberty or security.
-- Ben Franklin
.
- References:
- Creating DLL Entry Point
- From: FFrozTT
- Creating DLL Entry Point
- Prev by Date: Re: Creating DLL Entry Point
- Next by Date: Re: how could "atof" be so slow in vc2005?
- Previous by thread: Re: Creating DLL Entry Point
- Next by thread: converting char to LPCTSTR?
- Index(es):
Relevant Pages
|