Here is my problem, and im sure there is a relativly simple answer for
this...
I need to know if there is a way in C# to make the return of the sKey
string value untouched so i can have the entire string which would be
like this for the first 2 items "s101\0\0\0\0s101\0\0\0\0" as for now
the sKey value is getting stopped at the first \0 this is what I want
to stop. (no i cannot recompile the dll to not have null terminating
values)
I was thinking of using a IntPtr then to read the string via
Marshal.ReadByte but I do not know how to do that.
If I try to use string s = new string(new char[len]); it still null
terminates and results with just "s101".
Anybody have any bright idea's?
[DllImport("v4face2.dll", EntryPoint = "LOADHULLKEYS",
CharSet=CharSet.Ansi)]
public static extern void LoadHullKeys(
[MarshalAs(UnmanagedType.AnsiBStr)]ref string sPath,
ref int arrayPtr,
ref String sKey);
String sPath = "directoryPath";
int[] buffer = int[125];
String sKey = string.empty;
LoadHullKeys(ref sPath, ref int buffer[0], ref sKey)
Thanks,
R. Kozar
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web
Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/DotNetDevelopment?hl=en
-~----------~----~----~----~------~----~------~--~---