在.c文件中加载DLL时出现问题
谁能告诉我如何删除这个编译错误吗 将typedef更改为此可能有效:在.c文件中加载DLL时出现问题,dll,Dll,谁能告诉我如何删除这个编译错误吗 将typedef更改为此可能有效: typedef void (*EntryPointfuncPtr)(int argc, const char * argv ); HINSTANCE LoadME; LoadMe = LoadLibrary("LoadMe.dll"); if (LoadMe != 0) EntryPointfuncPtr LibMainEntryPoint; //GIve error in .c file but working fin
typedef void (*EntryPointfuncPtr)(int argc, const char * argv );
HINSTANCE LoadME;
LoadMe = LoadLibrary("LoadMe.dll");
if (LoadMe != 0)
EntryPointfuncPtr LibMainEntryPoint; //GIve error in .c file but working fine in Cpp file.
//Error:illegal use of this type as an expression
LibMainEntryPoint = (EntryPointfuncPtr)GetProcAddress(LoadMe,"entryPoint");
您的代码有两个问题:
typedef void (*EntryPointfuncPtr)(int, const char*);
安迪
typedef void (*EntryPointfuncPtr)(int argc, const char * argv);
HINSTANCE LoadMe;
LoadMe = LoadLibrary("LoadMe.dll");
if (LoadMe != 0)
{
EntryPointfuncPtr LibMainEntryPoint;
LibMainEntryPoint = (EntryPointfuncPtr)GetProcAddress(LoadMe,"entryPoint");
}