Dll managé utilise une dll non managé
Bonjour,
J'ai une dll qui contient du code non managé et je souhaite faire un dll en code manager qui utilise les fonctions de la dll non managé.
Mais pas moyen de compiler les dll. j'ai essayé plein de trucs mais la je suis perdu. Si quelqu'un sait comment si prendre.
Merci d'avance.
Dll manager utilisant une dll non manager
J'ai des erreurs de link :
TestCNet error LNK2020: unresolved token (0A00001E) _DebugHeapTag
TestCNet error LNK2020: unresolved token (0A000020) std._Lockit.__dtor
Dll manager utilisant une dll non manager
En fait vu que ça marchait pas j'ai essayé de suivre ce qui était indiqué dans la MSDN : http://support.microsoft.com/default...b;en-us;814472
Mais je me suis retrouvé bloqué lors de l'ajout de ce code la :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
// init.cpp
#include <windows.h>
#include <_vcclrit.h>
// Call this function before you call anything in this DLL.
// It is safe to call from multiple threads; it is not reference
// counted; and is reentrancy safe.
__declspec(dllexport) void __cdecl DllEnsureInit(void)
{
// Do nothing else here. If you need extra initialization steps,
// create static objects with constructors that perform initialization.
__crt_dll_initialize();
// Do nothing else here.
}
// Call this function after this whole process is totally done
// calling anything in this DLL. It is safe to call from multiple
// threads; is not reference counted; and is reentrancy safe.
// First call will terminate.
__declspec(dllexport) void __cdecl DllForceTerm(void)
{
// Do nothing else here. If you need extra terminate steps,
// use atexit.
__crt_dll_terminate();
// Do nothing else here.
} |
Du coup je me suis dit que j'allais refaire ma dll C++ manager pour repartir proprement.