DLL运行时动态加加载的问题

1、error C2440: 'initializing' : cannot convert from 'int (__stdcall *)(void)' to 'void (__cdecl *)(const char *)'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
   解决方法:要对GetProcAddress()函数的指针强制转换,如
                                          typedef void (*PFN)(LPCTSTR);
                PFN pfun=(PFN)::GetProcAddress(hModule,"ExportFunc");
 
2、

file: i386\chkesp.c Line: 42 

    解决方法:声明函数指针时用默认的调用__cdecl,而不要用__stdcall

posted @ 2014-03-16 11:55  qiaozhe  阅读(227)  评论(0编辑  收藏  举报