Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VC++ DLL -Continue
Message
De
25/08/2000 08:49:10
 
 
À
25/08/2000 06:56:50
Information générale
Forum:
Visual C++
Catégorie:
Autre
Divers
Thread ID:
00409097
Message ID:
00409162
Vues:
31
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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform