G
Guest
The following snippet throws a "ArgumentOutOfRangeException" exception in the
last line--
Int32 sizeWo=Marshal.SizeOf(wo);
ptrUWO = Marshal.AllocHGlobal(sizeWo*2);
Marshal.StructureToPtr(wo, ptrUWO, true);
It occurs if the last parameter in StructureToPtr is false as well.
I am using the OpenNetcf code in the actual app but it occurs if you use the
available Netcf methods as well.
The parameter "wo" is defined as--
Win32Com.OVERLAPPED wo = new Win32Com.OVERLAPPED();
OVERLAPPED is defined as follows--
[StructLayout( LayoutKind.Sequential )] internal struct OVERLAPPED
{
internal UIntPtr Internal;
internal UIntPtr InternalHigh;
internal UInt32 Offset;
internal UInt32 OffsetHigh;
internal IntPtr hEvent;
}
Any suggestions would be appreciated.
last line--
Int32 sizeWo=Marshal.SizeOf(wo);
ptrUWO = Marshal.AllocHGlobal(sizeWo*2);
Marshal.StructureToPtr(wo, ptrUWO, true);
It occurs if the last parameter in StructureToPtr is false as well.
I am using the OpenNetcf code in the actual app but it occurs if you use the
available Netcf methods as well.
The parameter "wo" is defined as--
Win32Com.OVERLAPPED wo = new Win32Com.OVERLAPPED();
OVERLAPPED is defined as follows--
[StructLayout( LayoutKind.Sequential )] internal struct OVERLAPPED
{
internal UIntPtr Internal;
internal UIntPtr InternalHigh;
internal UInt32 Offset;
internal UInt32 OffsetHigh;
internal IntPtr hEvent;
}
Any suggestions would be appreciated.