64,654
社区成员
发帖
与我相关
我的任务
分享
void _tmain(int argc, _TCHAR* argv[])
{
HRESULT hr;
//初始化COM
CoInitialize ( NULL );
//创建智能指针
MyComPlus::IHelloPtr ptr;
// 创建实例
hr = ptr.CreateInstance(__uuidof (MyComPlus::ComPlusTest));
class IDispEventImpl<0, T, pdiid, plibid, MajorVer, MinorVer, tihClass>
{
};
if(hr == S_OK)
{
while(true)
{
cout << ptr->SayHello("aaaa") << "\n";
}
}
CoUninitialize();
system( "pause ");
}
void _tmain(int argc, _TCHAR* argv[])
{
HRESULT hr;
//初始化COM
CoInitialize(NULL);
//创建智能指针
MyComPlus::IHelloPtr ptr;
// 创建实例
hr = ptr.CreateInstance(__uuidof(MyComPlus::ComPlusTest));
class IDispEventImpl<0, T, pdiid, plibid, MajorVer, MinorVer, tihClass>
{
};
if (hr == S_OK)
{
while (true)
{
cout << ptr->SayHello("aaaa") << "\n";
}
}
MSG msg;
while (int ret = ::GetMessage(&msg, NULL, 0, 0) != 0)
{
if (ret == -1) break; // handle the error and possibly exit
else
{
::TranslateMessage(&msg);
::DispatchMessage(&msg);
}
}
CoUninitialize();
return static_cast<int>(msg.wParam);
}