Board index » cppbuilder » Import an Interface to a Variant
George Adamopoulo
CBuilder Developer |
Sat, 23 Jul 2005 00:23:43 GMT
Import an Interface to a Variant
I would like to pack an interface to a variant in order to communicate with
an existing COM Dll ( implemented using DELPHI ). SAFEARRAY *pSafeArray; // Declaring a SafeArray IDispatch *pdisp = NULL; // Dispatch Type abound[0].lLbound = 0; // Array Bounds & IitPMtoOWStoreFromProdParams *spProdParams; // This pSafeArray =::SafeArrayCreate(VT_DISPATCH, 1, abound); for (long i = ZERO_VALUE; i < ONE_VALUE; i++) { spProdParams->nCostCenter = (*dbwrhouse)->WRHID; spProdParams->QueryInterface(IID_IDispatch, (void**)&pdisp); StoreParamsVar.vt = VT_DISPATCH | VT_ARRAY; When the program reaches the QueryInterface line produces an access Thanks in Advance. |