c++ dll 接口需要加聲明
運行時問題 :
虛接口抽象類 遇到
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.
This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
編譯問題:
具體dll函數遇到
DLL 找不到函數編譯連接時候。
實際是 DLL _stdcall。
vc _cdecl 。
#ifndef BUDLL
#define BUPUB_API
#else
#ifdef BUPUB_EXPORTS
#define BUPUB_API __declspec(dllexport)
#else
#ifdef _MSC_VER
#define BUPUB_API __declspec(dllimport)
#else
#define BUPUB_API
#endif
#endif
#endif
class BUPUB_API IMDListener{
#undef BUPUB_API
http://stackoverflow.com/questions/142644/weird-msc-8-0-error-the-value-of-esp-was-not-properly-saved-across-a-function