客户端调用com

客户端调用com

void opercom()
{
    ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
    //    {2D8EBDEE-437C-47c9-ABCC-F169E5E781D0}speeddial
    //    {85140985-7A18-4009-B5FB-43268FD154F8}ISpRecognizerLite
     
        CLSID CLSID_SpVoice;
        ::CLSIDFromProgID(L"SpeedDial", &CLSID_SpVoice);
        LPCLASSFACTORY pClsF;
        LPUNKNOWN punk;                   ::CoGetClassObject(CLSID_SpVoice,CLSCTX_INPROC_SERVER,NULL,IID_IClassFactory,(void**)&pClsF);
        pClsF->CreateInstance(NULL,IID_IUnknown,(void**)&punk);
    punk->QueryInterface(IID_ISpRecognizerLite,(void**)&非抽象类);
    ::CoUninitialize();
}

你可能感兴趣的:(客户端调用com)