从new->project->win32 dll(不带MFC)中建立的一个能导出函数的dll
其中加入:
void Test(void)
{
    cout <<"test";
    return;
}
可通过rundll32 test,Test却出现丢失条目:Test错误
这是怎么回事?好像找不到Test这个函数
哪里有dll的相关编写规范吗?谢谢^_^

解决方案 »

  1.   

    dll中函数申明前必须加上__declspec(dllexport)。
    如果你需要导出void Test(void)的话你需要像下面这样写函数申明:
    extern "C"
    {
      __declspec(dllexport) void Test(void);
    }
      

  2.   

    谢谢,问题解决,因为没有定义导出的函数
    要么用def,要么用你的方法 ;)
    查了些资料,需要rundll32能运行的方式函数必须这么声明
    void CALLBACK test(HWND hwnd,HINSTANCE hinst,char *param,int nCmdShow)