棘手问题:如何在两个以上的类里调用dll中定义的函数?只能在一个类里调用两个以上报错如下:
DealCenter.obj : error LNK2005: "class CString (__cdecl* FormatDate)(double,int)" (?FormatDate@@3P6A?AVCString@@NH@ZA) already defined in CorpAreaView.obj
JoinCarView.obj : error LNK2005: "class CString (__cdecl* FormatDate)(double,int)" (?FormatDate@@3P6A?AVCString@@NH@ZA) already defined in CorpAreaView.obj
StdAfx.obj : error LNK2005: "class CString (__cdecl* FormatDate)(double,int)" (?FormatDate@@3P6A?AVCString@@NH@ZA) already defined in CorpAreaView.obj
StdAfx.obj : error LNK2005: "struct HINSTANCE__ * gDS" (?gDS@@3PAUHINSTANCE__@@A) already defined in DealCenter.obj
e:/project/apps/cdc.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.高手帮忙阿?谢谢
谢谢
DealCenter.obj : error LNK2005: "class CString (__cdecl* FormatDate)(double,int)" (?FormatDate@@3P6A?AVCString@@NH@ZA) already defined in CorpAreaView.obj
JoinCarView.obj : error LNK2005: "class CString (__cdecl* FormatDate)(double,int)" (?FormatDate@@3P6A?AVCString@@NH@ZA) already defined in CorpAreaView.obj
StdAfx.obj : error LNK2005: "class CString (__cdecl* FormatDate)(double,int)" (?FormatDate@@3P6A?AVCString@@NH@ZA) already defined in CorpAreaView.obj
StdAfx.obj : error LNK2005: "struct HINSTANCE__ * gDS" (?gDS@@3PAUHINSTANCE__@@A) already defined in DealCenter.obj
e:/project/apps/cdc.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.高手帮忙阿?谢谢
谢谢
解决方案 »
- png图片除了某区域RGB(255,255,255)以外的区域抠出来png图片效果不变化///怎么做?
- socket通信中缓冲区的问题
- 请问能否用IE打开一个session?
- 如何将 HBITMAP 转化为 HDC? 以便在bitblt中画出来。
- 还有一个问题请问刚才那位高手.
- 急救!!!关于对话框中编辑框重画问题
- 在类的头文件生明指针函数问题??
- 在视里自动滚屏显示,急!!!
- 请教各位大虾。在VC中用什么方法可以代码实现给ACCESS数据库增加表?
- 关于outlook express .
- ISAPI Filter使用DllMain( )函数
- 一个非技术的问题,你用VC做什么或者做过什么项目??
void theFunction();你可以这样调用:type void (*FUNCTYPE)();
FUNCTYPE g_theFunc=NULL; //定义一个全局的函数指针变量。
如果你的别的CPP里也要调这个函数,则在那个CPP里声明
extern FUNCTYPE g_theFunc;然后:
HMODULE hMod = LoadLibray( "MYDLL.dll" );
g_theFunc = (FUNCTYPE)GetProcAddress( hMod, "theFunction" );
if( g_theFunc )
{
g_theFunc(); //这里调用了DLL里的函数。
}
签名:jmcooler