Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VC++ DLL -Continue
Message
From
25/08/2000 08:49:10
 
 
To
25/08/2000 06:56:50
General information
Forum:
Visual C++
Category:
Other
Miscellaneous
Thread ID:
00409097
Message ID:
00409162
Views:
30
Try the following code in a newly created VC++ Win32 DLL workspace.
// Test.h

extern "C"
{
// __declspec is a Microsoft specific extension.
__declspec(dllexport) int MySum(int first, int second);
}


// Test.cpp
#include "windows.h"
#include "test.h"

BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
   switch (ul_reason_for_call)
   {
      case DLL_PROCESS_ATTACH:
      case DLL_THREAD_ATTACH:
      case DLL_THREAD_DETACH:
      case DLL_PROCESS_DETACH:
         break;
   }

   return TRUE;
}


__declspec(dllexport) int MySum(int first, int second)
{
   return first + second;   
}
I have compiled and built this from VC++ 6 SP4 and checked the exported ordinal MySum appears correctly.

Leave the type library out for now, get the DLL running.
Previous
Reply
Map
View

Click here to load this message in the networking platform