Click here to Skip to main content
15,896,726 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have DLL in C in which one of my function will return a char buffer.

How do i get the buffer in VB.Net

I am using following code in C and VB.NET

C Code

C++
int my_buff(char * buff)
{
   memcpy(buffer,"testtest",8);

   return 1;

}


VB.Net Code

VB
<dllimport("mydll.dll",charset:->_

Overloads Shared Function my_buff(ByRef s() As Char) As Integer
End Function


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim lo as String=""

Dim j as Integer=0

j=my_buff(lo)

End Sub

how can i get the buffer that is written in C?
Posted
Updated 25-Sep-13 1:57am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900