fatypunk Java bien ! | Il est initialiser dans CreateInstance (j'avais pas posté)
Code :
- tv_dll = new DllCOM(dll);
- tv_dll->CreateInstance(clsid_TarmedValidator);
- ITarmedValidator * pITarmedValidator;
-
- void * pv;
- tv_dll->SwitchInterface(iid_ITarmedValidator, pv);
- pITarmedValidator = (ITarmedValidator *)pv;
- VARIANT_BOOL * p;
- HRESULT res;
- res = pITarmedValidator->Open(enFrench, p);
|
Code :
- void DllCOM::CreateInstance(CLSID clsid)
- {
- void * pv;
- switch (CoCreateInstance(clsid, NULL, CLSCTX_ALL, iid_IUnknown, &pv))
- {
- case S_OK :
- MessageBox(NULL, "ok", "CreateInstance", 0);
- break;
- case REGDB_E_CLASSNOTREG :
- MessageBox(NULL, "REGDB_E_CLASSNOTREG", "CreateInstance", 0);
- break;
- case CLASS_E_NOAGGREGATION :
- MessageBox(NULL, "CLASS_E_NOAGGREGATION", "CreateInstance", 0);
- break;
- case E_NOINTERFACE :
- MessageBox(NULL, "E_NOINTERFACE", "CreateInstance", 0);
- break;
- }
- pIUnknown = (IUnknown *)pv;
- }
|
Message édité par fatypunk le 24-08-2004 à 13:51:20
|