chpicker
Programmer
- Apr 10, 2001
- 1,316
I want to try to learn how to create a DLL, but have no idea where to start.
My first project is extremely simple. I want my DLL to contain a function called "addone" which takes an Integer as a parameter, adds 1 to it, and returns the new number.
After creating a Win32 DLL project in VC++, I have this as a starting CPP file:
[tt]
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}
[/tt]
I have absolutely no idea where to go from here. Is the DllMain function called when the DLL is loaded? Do I then simply add whatever functions I want available below this? Is there an identifier I have to put on my functions to allow access to them from a client application?
Ian
My first project is extremely simple. I want my DLL to contain a function called "addone" which takes an Integer as a parameter, adds 1 to it, and returns the new number.
After creating a Win32 DLL project in VC++, I have this as a starting CPP file:
[tt]
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}
[/tt]
I have absolutely no idea where to go from here. Is the DllMain function called when the DLL is loaded? Do I then simply add whatever functions I want available below this? Is there an identifier I have to put on my functions to allow access to them from a client application?
Ian