Bonjour !
Voil�, j'ai avec succ�s compil� des dlls avec Dev-C++ que je fais tourner
sans probl�me avec des programmes l�-encore compil� dans Dev-C++.
Mais si j'essaie de lancer mes dlls depuis une application cr��e avec C++ Builder, ca plante : j'ai une "access violation in machin.dll".
Voici une partie du code de la DLL :
Et voici l'appel depuis le programme :
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 extern "C" __declspec(dllexport) __stdcall void DLLCoocsMain(charg1*, long, long, long, long, long, std::string, std::string, std::string); //BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) int WINAPI DllEntryPoint (HINSTANCE hInst, unsigned long reason, void * lpReserved) { return TRUE; } extern "C" __declspec(dllexport) __stdcall void DLLCoocsMain(charg1* PtrLex3, long FP, long FM, long SM, long FenMot, long ICtx, std::string DelimsFenMots, std::string DelimsPhrase, std::string DelimsParag) {....
Quelqu'un a une id�e ? Ou mieux, un exemple de code ?
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 typedef void (__stdcall *DLLFUNC_COOCS)(charg1*, long, long, long, long, long, std::string, std::string, std::string); HINSTANCE hinstDLL; DLLFUNC_COOCS ImpFuncDLL; if ((hinstDLL=LoadLibrary ("coocs.dll"))) { ImpFuncDLL=(DLLFUNC_COOCS)GetProcAddress(hinstDLL, "DLLCoocsMain"); if (ImpFuncDLL) ImpFuncDLL(PtrClcharg, 28, 5, 5, 1, 1, "", ".?!", ""); if (ImpFuncDLL)MessageBox(NULL, "Validé", "Salut", MB_ICONERROR); else { return false; } FreeLibrary (hinstDLL); }
Merci !
Partager