//start the COM component
CoInitialize (NULL);
CComPtrSpUnknown;
CComPtrSpUnknown1;
CComPtrSpUnknown2;
CComPtrSpUnknown3;
SpUnknown. CoCreateInstance (CLSID_Control);
If (spUnknown==NULL)
{
return false;
}
SpUnknown1. CoCreateInstance (CLSID_Status);
If (spUnknown1==NULL)
{
return false;
}
SpUnknown2. CoCreateInstance (CLSID_Terminal);
If (spUnknown2==NULL)
{
return false;
}
SpUnknown3. CoCreateInstance (CLSID_Utility);
If (spUnknown3==NULL)
{
return false;
}
Call DLL, the return value to false, it is to initialize the COM CoInitialize (NULL);
Don't understand the problem, is it possible to is my registry not registered COM components? But I put in MFC can perform this code, the same can instantiate the pointer object, don't understand!
Pray god give advice or comments!
Pray god give advice or comments!
Pray god give advice or comments!
CodePudding user response:
First look at the error number, so that we can know the specific reason for the error,