Here is the third part (right below your usings) of an Example XP dll. Remember that this is the very last part of a XP dll:
Code Snippet: XP dll Part #3
- #pragma unmanaged
- BOOL WINAPI DllMain (HINSTANCE hDLL, DWORD dwReason, LPVOID lpReserved)
- {
- switch (dwReason)
- {
- case DLL_PROCESS_ATTACH:
- {
- MyXP.ModHdl=hDLL;
- XPRegCmd(&MyXP);
- break;
- }
- case DLL_PROCESS_DETACH:
- {
- XPUnregCmd(&MyXP);
- break;
- }
- }
- return TRUE;
- }
In truth, there is only one part that is optional. That is Line 1.
Line 1: This line is only needed if you are mixing standard C/C++ with .net code.
Otherwise, just copy it all at the bottom of the file and it will just work.
No comments:
Post a Comment