__declspec( dllexport ) int xxx(char * tostr)
{
char *p;
char *p1;
p = tostr;
p1 = tostr;
while (*p)
*p1++ = toupper (*p++);
return 0;
}

解决方案 »

  1.   

    PASCAL EXPORT 改成:WINAPI,PASCAL EXPORT大概在stdafx.h中定义,不过我没查过
      

  2.   

    你要这样做,首先在你的dll头文件里加一个宏
    #ifdef MYDLL_EXPORTS
    #define MYDLL_API __declspec(dllexport)
    #else
    #define MYDLL_API __declspec(dllimport)
    #endif
    在该DLL项目设置的C/C++页的"Preprocesser definitions"栏末尾里添上,MYDLL_EXPORTS
    以上表示在编译dll时导出,而在用这个dll时导入
    在dll头文件中定义函数原型:
    MYDLL_API int WINAPI xxx(char * tostr);
    在相应的.cpp文件中定义函数:
    int xxx(char * tostr)
    {
    char *p;
    char *p1;
    p = tostr;
    p1 = tostr;
    while (*p)
    *p1++ = toupper (*p++);
    return 0;
    }
    再建一个.def文件并加入到项目中去,在该def文件中填上
    EXPORTS
    xxx
    这样就可以了,要用这个dll时include前面的头文件就可以了