Re: Problems developing an application to PocketPC
From: Peter Foot [MVP] (feedback_at_nospam-inthehand.com)
Date: 08/05/04
- Next message: Peter: "Re: BindingManagerBase for the DataGrid"
- Previous message: Steven Licciardi: "2GB Compact Flash"
- In reply to: triki tron via .NET 247: "Problems developing an application to PocketPC"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 5 Aug 2004 09:30:24 +0100
There is a bug in AddrOfPinnedObject which returns first the size of the
array, so you have to add 4 to the resulting pointer (4 byte = length of
Int32). You could do this in VB like so:-
Dim aux As IntPtr = CType(handle.AddrOfPinnedObject().ToInt32() + 4, IntPtr)
Peter
-- Peter Foot Windows Embedded MVP www.inthehand.com Do have an opinion on the effectiveness of Microsoft Windows Mobile and Embedded newsgroups? Let us know! https://www.windowsembeddedeval.com/community/newsgroups "triki tron via .NET 247" <anonymous@dotnet247.com> wrote in message news:%233n6enheEHA.1424@tk2msftngp13.phx.gbl... > (Type your message here) > I have proved this code in an application for PC and works OK: > > > Dim RxBufferDatos(40) As Byte > Dim Arbuffer() As Byte > > ReDim Preserve Arbuffer(ContadorDatos + nbRx - 1) > > Dim handle As GCHandle = GCHandle.Alloc(RxBufferDatos, > GCHandleType.Pinned) > Dim aux As IntPtr = handle.AddrOfPinnedObject() > Marshal.Copy(aux, Arbuffer, ContadorDatos, RxBufferDatos.Length) > handle.Free() > > > This copies a number of bytes from "RxBufferDatos" to "Arbuffer". > > But when I copy this code to an application to a PocketPC, this doesn?t > work OK. > Do you know why and how can I do it? > > > -------------------------------- > From: triki tron > > ----------------------- > Posted by a user from .NET 247 (http://www.dotnet247.com/) > > <Id>n5sKkgAM1UKL7KlDR1sSiQ==</Id>
- Next message: Peter: "Re: BindingManagerBase for the DataGrid"
- Previous message: Steven Licciardi: "2GB Compact Flash"
- In reply to: triki tron via .NET 247: "Problems developing an application to PocketPC"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|