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

    Returning strings from C DLL

    I've become responsible for some old code which returns a newly allocated string to a VB app. We just switched over from Visual C++ 2.1 to Visual C++ 4.2. Apparently 4.2 no longer supports automatic conversion of strings, so we cannot allocate a BSTR properly and return it to the VB App.

    My question is, what is the correct way to allocate and return a string to a VB app from a DLL, given a char*?

    Cheers beers,

    Ant.


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: Returning strings from C DLL

    you need to call SysAllocString as documented in
    MSDN article Q196976


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