I am very new in ActiveX and also just getting familiar with COM (Component Object Model).
How can I obtain an IUnknown pointer from an ActiveX object?
my code is:
------------------------------
//some variables: FdtType_FdtXmlDocument SupportedProt = 0;
IUnknown *interfacePtr;
HRESULT error;
CAObjHandle TCICommSrv;
ERRORINFO errorInfo;//the code part: DisplayPanel (panelHandle);
CA_InitActiveXThreadStyleForCurrentThread(0, COINIT_APARTMENTTHREADED);
error = CA_CreateObjectByProgIdEx("TCI.SimaticCommunicationServer.1", NULL, &IID_IUnknown, 1, LOCALE_NEUTRAL, 0, &TCICommSrv);
CA_GetAutomationErrorString (error, buffer, buffersize);
CA_DisplayErrorInfo(TCICommSrv, "error info", error, 0);
CA_ServerQueryInterface(interfacePtr, &Fdt_IID_IFdtCommunication, &newInterfacePtr); //end codeAs far as I know the QueryInterface method is for gathering the interfaces supported by the ActiveX server? Am I right?
That is why I seek for if the implemented interface (Fdt_IID_IFdtCommunication) exists? So at this point I don't know
what should be the first parameter (interfacePtr) for this QueryInterface function. Somehow the interfacePtr is not good.
Thanks,
Roland