ASCII LpSTR?
-
I'm trying to make a call into a compression dll This is declared like this in VB6:
Private Declare Function compress Lib "compression.dll" (dest As Any, destLen As Any, src As Any, ByVal srcLen As Long) As Long Private Declare Function uncompress Lib "compression.dll" (dest As Any, destLen As Any, src As Any, ByVal srcLen As Long) As Long
I've added the following to a c# class[DllImport("compression.dll")] public static extern int uncompress(ref byte[] inputBuffer, ref int inputLength, ref byte[] outputBuffer, int OutputLength); [DllImport("compression.dll")] public static extern int compress( [MarshalAs(UnmanagedType.LPStr)] StringBuilder inputBuffer,ref int inputLength, [MarshalAs(UnmanagedType.LPStr)] StringBuilder outputBuffer, int OutputLength);
If i call the compress method using c# and decompress using c# this works fine. The problem arises when i try to compress in c# and decompress in vb6 or vice versa. Is there a back compatability mode for string functions like this? Thanks in advance Russell -
I'm trying to make a call into a compression dll This is declared like this in VB6:
Private Declare Function compress Lib "compression.dll" (dest As Any, destLen As Any, src As Any, ByVal srcLen As Long) As Long Private Declare Function uncompress Lib "compression.dll" (dest As Any, destLen As Any, src As Any, ByVal srcLen As Long) As Long
I've added the following to a c# class[DllImport("compression.dll")] public static extern int uncompress(ref byte[] inputBuffer, ref int inputLength, ref byte[] outputBuffer, int OutputLength); [DllImport("compression.dll")] public static extern int compress( [MarshalAs(UnmanagedType.LPStr)] StringBuilder inputBuffer,ref int inputLength, [MarshalAs(UnmanagedType.LPStr)] StringBuilder outputBuffer, int OutputLength);
If i call the compress method using c# and decompress using c# this works fine. The problem arises when i try to compress in c# and decompress in vb6 or vice versa. Is there a back compatability mode for string functions like this? Thanks in advance RussellRussell Jones wrote:
The problem arises
What is the problem... an error message, invalid data, what? Please provide a little detail.
topcoderjax - Remember, Google is your friend. Try this Custom Google Code Search