Small addition. There is the code how I invoke this method in VS 2010:
IClass1* iboj1
IClass2* iboj2
CoCreateInstance(__uuidof(Class1), NULL, CLSCTX_ALL, __uuidof(IClass1), reinterpret_cast<void**>(&iboj1));
CoCreateInstance(__uuidof(Class2), NULL, CLSCTX_ALL, __uuidof(IClass2), reinterpret_cast<void**>(&iobj2));
iobj2->Init(iobj2);
IClass1* iboj1
IClass2* iboj2
CoCreateInstance(__uuidof(Class1), NULL, CLSCTX_ALL, __uuidof(IClass1), reinterpret_cast<void**>(&iboj1));
CoCreateInstance(__uuidof(Class2), NULL, CLSCTX_ALL, __uuidof(IClass2), reinterpret_cast<void**>(&iobj2));
iobj2->Init(iobj2);
To copy to clipboard, switch view to plain text mode
but When I trying the same in Qt I have an error
/*
Class1, IClass1, Class2, IClass2 from files generated with dumpcpp
*/
Class1* obj1 = new Class1();
int count = obj1->Count(); // working fine
IClass1* iObj1 = NULL;
obj1->queryInterface(IID_IUnknown, reinterpret_cast<void**>(&iObj1));//working fine
Class2* obj2 = new Class2();
IClass2* iObj2 = NULL
obj2->queryInterface(IID_IUnknown, reinterpret_cast<void**>(&iObj2));//working fine
iobj2->Init(iObj1); //:-1: error: Exception at 0x759b7199, code: 0xc0000005: read access violation at: 0x0, flags=0x0 (first chance)
/*
Class1, IClass1, Class2, IClass2 from files generated with dumpcpp
*/
Class1* obj1 = new Class1();
int count = obj1->Count(); // working fine
IClass1* iObj1 = NULL;
obj1->queryInterface(IID_IUnknown, reinterpret_cast<void**>(&iObj1));//working fine
Class2* obj2 = new Class2();
IClass2* iObj2 = NULL
obj2->queryInterface(IID_IUnknown, reinterpret_cast<void**>(&iObj2));//working fine
iobj2->Init(iObj1); //:-1: error: Exception at 0x759b7199, code: 0xc0000005: read access violation at: 0x0, flags=0x0 (first chance)
To copy to clipboard, switch view to plain text mode
I can't figure out why it happens?
Bookmarks