Hi,
I have a COM object that generates an object for a VB app, which stores it and then passes it back to the COM object for further manipulation. I can generate it fine, but can't figure out how to pass a VB "object" back to COM. Specifically I keep getting Access Violations when I call QueryInterface.
VB CODE:
Engine.getObject returns a VT_DISPATCH pointer to a custom IForioObject.
C++ CODE:
On this last line, my C code always crashes with a access violation. It appears that the VB code is not passing in the original object.
Any ideas out there? Help is appreciated.
Best, WILL
I have a COM object that generates an object for a VB app, which stores it and then passes it back to the COM object for further manipulation. I can generate it fine, but can't figure out how to pass a VB "object" back to COM. Specifically I keep getting Access Violations when I call QueryInterface.
VB CODE:
Code:
Set obj = Engine.getObject ' works fine
EngineFactory.saveObject obj ' doesn't work
Engine.getObject returns a VT_DISPATCH pointer to a custom IForioObject.
C++ CODE:
Code:
STDMETHODIMP CEngine::saveObject(BSTR *PathName, IDispatch *Model, VARIANT_BOOL *ReturnVal)
IForioObject *ForioObj;
HRESULT hr = Model->QueryInterface(IID_IForioObject, (void**)&ForioObj);
On this last line, my C code always crashes with a access violation. It appears that the VB code is not passing in the original object.
Any ideas out there? Help is appreciated.
Best, WILL