How to change BSTR in Visual Basic as VC++?
-
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..
-
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..
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