Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question/* le fichier .cpp de la DLL */ #include "Classes.h" // défini apres #include <windows.h> #define DLLEXPORT __declspec (dllexport) BOOL APIENTRY DllMain (HINSTANCE hInst /* Library instance handle. */ , DWORD reason /* Reason this function is being called. */ , LPVOID reserved /* Not used. */ ) { switch (reason) { case DLL_PROCESS_ATTACH: break; case DLL_PROCESS_DETACH: break; case DLL_THREAD_ATTACH: break; case DLL_THREAD_DETACH: break; } /* Returns TRUE on success, FALSE on failure */ return TRUE; } /* le code de classes.h */ #if _MSC_VER > 1000 #pragma once #endif #ifndef _WINDOWS_H_ #include <windows.h> #endif #ifndef _STDIO_H_ #include <stdio.h> #endif #ifndef _IOSTREAM_H_ #include #endif class String { public: String(void); String(int num); String(double num); // autres instructions... }; String::~String(void) { delete val; delete fval; } String::String(void) { this->val = new char[MAX_PATH]; lstrcpy(this->val, ""); this->fval = new char[MAX_PATH]; lstrcpy(this->val, ""); this->length = 0; this->flength = 0; } // autres définitions des fct....
#define DLLIMPORT __declspec (dllimport) // autres bidules... int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { HINSTANCE hDLL; hDLL = LoadLibrary("Test.dll"); String lol; }