初学者提问。我用VC的向导生成的DLL模板编译以后用察看资源的工具察看怎么定义的接口函数名都是乱码?

解决方案 »

  1.   

    Access the link below, FYI: http://www.codeproject.com/dll/
      

  2.   

    mydll.h#ifdef __cplusplus
    extern "C"
    #endif
    int WINAPI MyFunc(int a, char *b);Mydll.cppint WINAPI MyFunc(int a, char *b)
    {
    ....
    }Mydll.def
    EXPORTS
    MyFunc @1
      

  3.   

    http://www.mindcracker.com/mindcracker/c_cafe/dll/reg_dll_dlg.asp
      

  4.   

    生成标准的DLL一般得包含如下的内容:
    1)dllmain()函数;
    2)导出函数:
    extern "C" __declspec(dllexport) <yourtype> <yourfunction>(<yourtype>)
    {
    ...;
    }
    3) DEF文件,其中列有导出函数的名称列表。
      

  5.   

    楼上说的对,要用extern "C"声明并且要有DEF文件
      

  6.   

    我做了实验可以不用extern "C"来声明函数。