B
Brian
Hi all,
I'm collaborating on a project with another developer, he's the C++ guy, I'm
the .NET guy, and getting my code to talk to his code is causing some
headaches. I'm hoping some of this is simple.
In the C++ dll, there's a function defined like (chopping off the extern
"c", et. al.):
.... int WINAPI Play(char * Filename,int Loop, int Sync)
What is the proper way (VB.NET or C#) to pass in the filename in my
P/Invoke? Right now I've got (realizing the string likely won't cut it):
<DllImport("mydll.dll")> Public Shared Function Play(ByVal Filename As
String, ByVal mLoop As Int32, ByVal mSync As Int32) As Int32
End Function
Similarly there are functions that return char*, such as (chopping off the
extern "c", et. al.):
.... char* WINAPI Test();
I've seen a few posts around the net on similar issues using a byte array or
stringbuilder, but am feeling a tad lost right now...
Thanks for the help!
Brian
I'm collaborating on a project with another developer, he's the C++ guy, I'm
the .NET guy, and getting my code to talk to his code is causing some
headaches. I'm hoping some of this is simple.
In the C++ dll, there's a function defined like (chopping off the extern
"c", et. al.):
.... int WINAPI Play(char * Filename,int Loop, int Sync)
What is the proper way (VB.NET or C#) to pass in the filename in my
P/Invoke? Right now I've got (realizing the string likely won't cut it):
<DllImport("mydll.dll")> Public Shared Function Play(ByVal Filename As
String, ByVal mLoop As Int32, ByVal mSync As Int32) As Int32
End Function
Similarly there are functions that return char*, such as (chopping off the
extern "c", et. al.):
.... char* WINAPI Test();
I've seen a few posts around the net on similar issues using a byte array or
stringbuilder, but am feeling a tad lost right now...
Thanks for the help!
Brian