DLL
-
HI there how to create a dll and how to use it can anybody tell me. if i create a dll and dont use a def file does it export a dll. DLL_API int fnDll(void) { return 42; } #ifdef DLL_EXPORTS #define DLL_API __declspec(dllexport) #else #define DLL_API __declspec(dllimport) #endif and rest of the code. if i dont use a def file i think i canot export that function. is that so. swarup
-
HI there how to create a dll and how to use it can anybody tell me. if i create a dll and dont use a def file does it export a dll. DLL_API int fnDll(void) { return 42; } #ifdef DLL_EXPORTS #define DLL_API __declspec(dllexport) #else #define DLL_API __declspec(dllimport) #endif and rest of the code. if i dont use a def file i think i canot export that function. is that so. swarup
declare the funcion you want to export as
extern "C" __declspec( dllexport) BOOL Function(char *buffer,char *tg);
in your DLL project In the Project that need the function do declare in header fileextern "C" __declspec( dllimport ) BOOL Function(char *buffer,char *tg);
HANDLE hDLL=LoadLibrary("dllname"); if(hDLL == NULL) { //handle error }
hope it helps Paolo