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

    Marshaling Dispatch Pointers

    I am having a very frustrating time trying to pass interface pointers as parameters.

    I am writing components with ATL and testing them in a Visual Basic application.

    I have two problems:

    1. I am calling a method in a method on an In-Process object in multi threaded Apartment via Proxy/Stub. The method should return an IDispatch pointer, but the marshalling generates an error.

    To try to find it, I have disabled Type-Library marshaling and merged the ATL generated Proxy/Stub into my DLL. I have also removed the /Oicf so that I can debug into the marshalling code. I see that an exception is thrown by the function NdrPointerBufferSize(), but I don't know why.

    With type library marshaling, the same basic effect occurs, so it doesn't seem to be a fault in the Proxy/Stub code

    2. The other problem has nothing to do with marshalling. I have defined a method which takes an interface pointer as a parameter and a property which is an interface pointer. I have implemented whtm with identical functionality. When I use them from Visual Basic, only the Property works. The Method fails, without even being entered. The error message is something like, this method is not supported. I cannot for the life in me understand why the property should work, but the method should fail. (I would prefer to use a method, because it makes more sense in the application).

    The problem only occurs from VB. I can call the method without any problem from VC++.

    Phil Jollans

  2. #2
    Join Date
    Apr 1999
    Posts
    1

    Re: Marshaling Dispatch Pointers

    I work in a team at a project using DCOM. We encountered some problems with marshaling a Dispatch Interface. The problems have been resolved when we put in idl file the specification [out, retval] for the Dispatch parameter. Of course the parameter must be IDispatch**.
    Maybe this can resolve your communication via Proxy/Stub.



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