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
    37

    Dual Interface & BSTR

    When make a IDL for dual interface, we must choose parameter's type from only VARIANT and BSTR.
    Using other type, VC++ compiler warns me of in-compatiablity with Dual Interface.

    So, I have used only VARIANT and BSTR as a parameter's type of dual interface.
    But, I needed to use a reference of BSTR.
    I wrote IDL as follows.

    [id(1), helpstring("method Parse")] HRESULT Parse([in] BSTR args, [out] BSTR* htmlResult, [out, retval] short* result);

    It was successfully compiled and runned well in VB.
    But, in ASP, it occurred type mismatch error at "htmlResult" parameter.
    Besides, I don't know if its VC++ client would release the memory of htmlResult using SysFreeString.

    Let me see wise answers of above two stupid question.

    Regards

    A programmer who loves Goethe.

  2. #2
    Join Date
    May 1999
    Posts
    69

    Re: Dual Interface & BSTR

    Only automation types in dual interfaces because must be able to call through invoke.
    [in] argument: client allocate, server release memory
    [out] argument: server allocate, client release
    [in, out] argument: client allocate and release

    I don't know why reference with html does not work
    bstr is (I think) LPOLESTR (this *is* a reference, or not?)

    sorry cannot tell you more

    chrislaw

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