好像是函数输出接口吧,动态链接库中的函数声明时加上__declspec(dllexport)__stdcall后, 在主程序中也声明一下这个函数,前面加上__declspec(dllinport)__stdcall就可以使用了。

解决方案 »

  1.   

    提供的一种导出函数方式,该方式具有__stdcall调用机制
      

  2.   

    例子。void main(void) 
       {
           func1();
       }
    编译器产生这样的代码;call func1
    连接器这样调用:call 0x4000000         ; 'func1'的地址.
    如果func1()在另外的dll里,那么连接器会增加一个thunk:
    0x40000000:    jmp DWORD PTR __imp_func1
    __imp_func1是真正的函数地址。它在一个exe文件里的导出地址表里。这样会使文件增大并且降低缓存性能。如果这样写的话
    __declspec(dllimport) void func1(void);
       void main(void) 
       {
           func1();
       }
    会这样调用:call DWORD PTR __imp_func1没有多余的thunk,代码不仅小而且快。
    __stdcall仅仅是一种调用方式。
      

  3.   

    __declspec(dllexport) 定义了EXPORT表示函数是引出函数
    __stdcall 
    函数参数入stack的顺序 从右到左Element Implementation 
    Argument-passing order Right to left. 
    Argument-passing convention By value, unless a pointer or reference type is passed. 
    Stack-maintenance responsibility Called function pops its own arguments from the stack. 
    Name-decoration convention An underscore (_) is prefixed to the name. The name is followed by the at sign (@) followed by the number of bytes (in decimal) in the argument list. Therefore, the function declared as int func( int a, double b ) is decorated as follows: _func@12 
    Case-translation convention None