使用现有的COM

#include "ClassDll.h"
#include "ClassDll_i.c"


if ( FAILED( CoInitialize(NULL) ))
{
return;
}

IClass* pIClass;

hr = CoCreateInstance(CLSID_Class,
NULL,
CLSCTX_INPROC_SERVER,
IID_IClass,
(void**) &pIClass);

if ( SUCCEEDED(hr) )
{
//hr = pIClass->Method();

if ( SUCCEEDED(hr) )
{
}
else
{
}

pIClass->Release();
}

CoUninitialize();

你可能感兴趣的:(com)