CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 1999
    Posts
    9

    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?


  2. #2
    Join Date
    Nov 1999
    Posts
    9

    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured