Click to See Complete Forum and Search --> : Creating a DLL
April 30th, 1999, 10:20 AM
Hi,
I am trying to create my first DLL and I would be interested in any suggestions on where to get information on creating a DLL. If anyone knows of any
books/web sites where I can find tutorials/examples in C/C++ please let me know.
Thanks
Chad
Doofus
April 30th, 1999, 11:59 AM
Try www.msdn.microsoft.com
Then choose "library"
Then do a normal search for your topic
LOTS of info there
ericjazz
June 2nd, 1999, 02:36 PM
I've gone through MSDN and drove myself quite mad with MFC references and such. I am looking for a basic, "Hello World" DLL example to understand the process. Currently using VC5.0 in Win98, I am not a Windows programmer. Any help would contribute greatly to maintaining the sanity of another human being, let your altruistic side go, just don't let the Objectivists know! ;)
TIA
Gomez Addams
June 2nd, 1999, 03:05 PM
Check out the MFC samples DLLHUSK and DLLTRACE.
It might also help for you to place some TRACE statements in the
DllMain function of the library so you can see when and why DllMain
is called. This can be very enlightening. There are also several
articles in the DLL section of this site that are worth checking out.
Just for giggles, here is a basic DllMain function that you can start with.
I'll also throw in one exported function. Make a little testing app to call
this function and watch the debug output. The app wiz can generate
projects for the app and the DLL for you.
BOOL WINAPI DllMain( HINSTANCE hInstDll, DWORD dwReason, LPVOID lpReserved )
{
switch( dwReason )
{
case DLL_PROCESS_ATTACH :
TRACE( "DllMain - DLL_PROCESS_ATTACH\n" );
break;
case DLL_PROCESS_DETACH :
TRACE( "DllMain - DLL_PROCESS_DETACH\n" );
break;
case DLL_THREAD_ATTACH :
TRACE( "DllMain - DLL_THREAD_ATTACH\n" );
break;
case DLL_THREAD_DETACH :
TRACE( "DllMain - DLL_THREAD_DETACH\n" );
break;
}
return TRUE;
}
#define DllExport __declspec(dllexport)
DllExport int TestFunction( int iarg )
{
TRACE( "TestFunction called with argument %d\n", iarg );
return 0;
}
Post again if you have more questions.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.