Converting from IStorage to IDispatch
I am trying to pass an OLE object through an OCX. I am fairly new to COM, and I am having trouble with converting from C++ to VB. With c++ I return an IStorage object (as an IUnknown* in a Variant) then create the ole object based on the IStorage that has the bytes of the OLE object. I use OleLoad, OleCreate, IAdviseSunk, IClientSite... in order to create the object and it works fine. The problem is in VB I believe that the OLE objects are built on IDispatch and I can't see how to convert from IStorage or IStream to IDispatch, Any hints. I can't just QueryInterface for IDispatch from the IStorage or the IOleObject.
What is the storage that OleObjects in VB are built on?
Re: Converting from IStorage to IDispatch
In case anyone is interested.
You can create a container in the OCX code and call OleRun(IOleObject*). Then call QueryInterface for the IDispatch from the IOleObject. The key to automation is having the application server running.