Safe for 64-bit?
Tech-Archive recommends: Speed Up your PC by fixing your registry
Heya. I'm doing a interop call to a function that returns a
System.Runtime.InteropServices.ComTypes.IDataObject. I use the GetData
member and STGMEDIUM.unionmember to get an IntPtr to the data. With this
IntPtr, I'm extracting the result.
Now, I use this piece of code to set the pointer to a starting position:
IntPtr current = IntPtr.Zero;
current = (IntPtr)((int)current + (Marshal.SizeOf(typeof(uint)) * 2));
and later I use this code to move the pointer:
current = (IntPtr)((int)current + Marshal.SizeOf(typeof(DS_SELECTION)));
Now, we use this on a 32-bit system. Would this work on a 64-bit system
(assuming we compile the application for 64-bit systems).
Cheers,
/Chris
.
Relevant Pages
- Help with Marshaling an Array of Pointers from COM to Managed Objects
... Dim pDesktop As IntPtr ... Dim pidlRecyclebin As IntPtr ... ByRef pceltFetched As IntPtr) As UInt32 ... 'Requests a pointer to an interface that allows a client to enumerate ... (microsoft.public.dotnet.framework.interop) - Re: P/Invoke structure question
... I always thought IntPtr is for integer. ... It's also possible that the allocation happens inside the dll, ... Marshal.PtrToStruct, Marshal.StructToPtr, depending on what the pointer ... difference between UIntPtr and IntPtr. ... (microsoft.public.dotnet.languages.csharp) - Re: Void pointer to managed object type
... Typically you can solve that problem with the IntPtr type. ... pointer out of it. ... That's if you need to store a void* in a managed type. ... There are restrictions regarding tracking references and pointers. ... (microsoft.public.dotnet.languages.vc) - Re: Problems calling a C function containing pointers.
... It returns a value at the address of the pointer. ... > public static extern Char SomeFunction(ref int numberOfRays, IntPtr ... > rayDirs); ... The float array must be marshaled to a managed float array, ... (microsoft.public.dotnet.languages.csharp) - Re: External listview control memory exception when sendmessage is
... Gary Chanson ... Mostly this error comes when we assign null value to a pointer but in our ... IntPtr mainWindowHwnd; ... LVITEM lvi = new LVITEM; ... (microsoft.public.win32.programmer.ui) |
|