Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to change BSTR in Visual Basic as VC++?

How to change BSTR in Visual Basic as VC++?

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lsh486love
    wrote on last edited by
    #1

    Hi, Private Sub Command1_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command1.Click Dim barcord1 As String barcordreader = New HANBARCORDLib.barcord barcordreader.ReadBarcord("c:\image.raw") barcordreader.GetBarcord1(barcord1) Text1.Text = barcord1 End Sub End Class the variable, barcord1 is declared by "String". And it is possible that a parameter of the method, "barcordreader.GetBarcord1(BSTR*)". But I don't know how to change the code by Visual C++. I actually made it like this : BSTR barcord1[64]={NULL,}; barcordreader.GetBarcord1(barcord1); but it doesn't work. I want to get result as a type of string. please help me. Thanks for reading..

    S 1 Reply Last reply
    0
    • L lsh486love

      Hi, Private Sub Command1_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command1.Click Dim barcord1 As String barcordreader = New HANBARCORDLib.barcord barcordreader.ReadBarcord("c:\image.raw") barcordreader.GetBarcord1(barcord1) Text1.Text = barcord1 End Sub End Class the variable, barcord1 is declared by "String". And it is possible that a parameter of the method, "barcordreader.GetBarcord1(BSTR*)". But I don't know how to change the code by Visual C++. I actually made it like this : BSTR barcord1[64]={NULL,}; barcordreader.GetBarcord1(barcord1); but it doesn't work. I want to get result as a type of string. please help me. Thanks for reading..

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2

      BSTR barcord1;
      barcordreader.GetBarcord1(&barcord1);
      // Do stuff with the BSTR
      ::SysFreeString(barcord1);

      Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups