I'm having trouble passing strings to a C++ DLL from my vb.net program. I get constant Read/Write memory error exceptions. My C++ code is as follows:
And i'm using this function in my vb.net code as follows:Code:char * get_signal_desc(char * dev) { bool status; char * desc; status = get_dev_signal_desc(dev, desc); return desc; }
I get the exception at the line where i call the C++ function. Can anyone help me figure out how to pass strings between a C++ DLL and vb.net program?Code:Public Declare Function get_signal_desc Lib "Core_Wrapper.dll" (ByVal sig As String) As String Dim sig As String Dim desc As string desc.= Space(255) sig = "MRG31025" desc = get_signal_desc(sig) MessageBox.Show(desc.ToString)


Reply With Quote