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

    String from a dll

    Hi,

    I am calling a dll function that returns a string in VB. In the dll I am returning a BSTR.
    But in VB i get only the first letter of the string
    The function is declared in VB as

    Declare Function GetFileName Lib "MyDll.dll" () as string




    And I in the code I am calling

    Dim strTemp as string
    strTemp = GetFileName




    How can I get the whole string ?


  2. #2
    Join Date
    Apr 2000
    Posts
    737

    Re: String from a dll

    seems like your are encounter the problem of ANSI and UNICODE conversion. maybe you should consider return char* instead of BSTR.

    HTH

    cksiow
    http://vblib.virtualave.net - share our codes



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