描述:
高手给看看这样对马??传char*的参数有什么特殊的要求吗?
定义处typedef LPTSTR (*lpReadXML)(char* bstrFileID);
函数调用处
char* fileID;
lpReadXML lpfnDllFuncRead;
HINSTANCE hDLL;
hDLL = ::LoadLibrary("OcxFileService.dll");
if (hDLL != NULL)
{
lpfnDllFuncRead = (lpReadXML)GetProcAddress(hDLL,"readXML");
if (!lpfnDllFuncRead)
{
FreeLibrary(hDLL);
return FALSE;
}
else
{
// call the function
lpfnDllFuncRead(fileID);
}
为什么总调试不过呢????????
解决方案1:
恩。。。他们说的对,你贴出的代码我试过了,没有问题!!!
解决方案2: 这是COM初始化问题了
和DLL调用没有关系
error C2259: 'CComObject<class CXMLSelect>' : cannot instantiate abstract class due to following members:
c:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(1823) : while compiling class-template member function 'long __stdcall ATL::CComCreator<class ATL::CComObject<class CXMLSelect> >::CreateInstance(void *,const struct _GUID &,void ** )'
上面的错误与楼主贴出来的代码无关,它是说楼主程序中的类CXMLSelect有一些虚函数未重载(估计是楼主从接口派生的某些函数搞忘了),楼主检查一下CXMLSelect的定义以确定一下。