我是atl技术的初学者,
我创建一个com对象后调用welcome函数,运行出现下列提示情况:
--------------Configuration: a - Win32 Debug--------------------
Compiling...
aDlg.cpp
Linking...
aDlg.obj : error LNK2001: unresolved external symbol _CLSID_SimpleInterface
aDlg.obj : error LNK2001: unresolved external symbol _IID_ISimpleInterface
Debug/a.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.程序如下:
HRESULT hr;
ISimpleInterface* pIntf = NULL;
hr = CoCreateInstance
(CLSID_SimpleInterface, NULL, CLSCTX_SERVER ,
IID_ISimpleInterface, (void **)& pIntf);
if(SUCCEEDED(hr))
{
pIntf->Welcome();
pIntf->Release();
}
能告诉我为什么吗?
我该怎么做?
我创建一个com对象后调用welcome函数,运行出现下列提示情况:
--------------Configuration: a - Win32 Debug--------------------
Compiling...
aDlg.cpp
Linking...
aDlg.obj : error LNK2001: unresolved external symbol _CLSID_SimpleInterface
aDlg.obj : error LNK2001: unresolved external symbol _IID_ISimpleInterface
Debug/a.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.程序如下:
HRESULT hr;
ISimpleInterface* pIntf = NULL;
hr = CoCreateInstance
(CLSID_SimpleInterface, NULL, CLSCTX_SERVER ,
IID_ISimpleInterface, (void **)& pIntf);
if(SUCCEEDED(hr))
{
pIntf->Welcome();
pIntf->Release();
}
能告诉我为什么吗?
我该怎么做?
虽然出错没有了
但是不能弹出MessageBox
是不是少了哪些步骤?
http://dev.csdn.net/develop/article/22/22802.shtm
看一下这个相关的系列。
浅显易懂。