Click here to Skip to main content
15,914,488 members
Home / Discussions / C#
   

C#

 
GeneralRe: how do I marshal lpvoid pointer in a funcion? Pin
Paolo Ponzano13-May-04 4:40
Paolo Ponzano13-May-04 4:40 
GeneralRe: how do I marshal lpvoid pointer in a funcion? Pin
Heath Stewart13-May-04 5:04
protectorHeath Stewart13-May-04 5:04 
GeneralRe: how do I marshal lpvoid pointer in a funcion? Pin
Paolo Ponzano13-May-04 5:27
Paolo Ponzano13-May-04 5:27 
GeneralRe: how do I marshal lpvoid pointer in a funcion? Pin
Heath Stewart13-May-04 6:21
protectorHeath Stewart13-May-04 6:21 
GeneralRe: how do I marshal lpvoid pointer in a funcion? Pin
Paolo Ponzano13-May-04 7:20
Paolo Ponzano13-May-04 7:20 
GeneralRe: how do I marshal lpvoid pointer in a funcion? Pin
Heath Stewart13-May-04 9:37
protectorHeath Stewart13-May-04 9:37 
GeneralRe: how do I marshal lpvoid pointer in a funcion? Pin
Paolo Ponzano13-May-04 11:43
Paolo Ponzano13-May-04 11:43 
GeneralRe: how do I marshal lpvoid pointer in a funcion? Pin
Heath Stewart13-May-04 12:36
protectorHeath Stewart13-May-04 12:36 
You should read the documentation for the IntPtr. First, you only need the GCHandle to get the address of the byte[] array. For any other numbers you need to pass where the param Type is an IntPtr (processor-dependent bit width), just use create a new IntPtr passing the number into the constructor, like:
IntPtr ptr = new IntPtr(p.Handle);
If the Handle was 12345, then the IntPtr created with this as a param would be:
// On a 32-bit platform:
0x00003039
// On a 64-bit platform:
0x0000000000003039
This is not the address of the numeric variable, merely the number wrapped in a platform-dependent numeric type. The only place you need the address is for the byte[] array. Using the GCHandle is just the easiest way in the .NET CF to get it's address (the address of the first element which the rest of the elements allocated on the stack, which is why you pass the number of bytes in the array as the next param to Toolhelp32ReadProcessMemory.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: how do I marshal lpvoid pointer in a funcion? Pin
Paolo Ponzano13-May-04 20:18
Paolo Ponzano13-May-04 20:18 
GeneralRe: how do I marshal lpvoid pointer in a funcion? Pin
Heath Stewart14-May-04 2:16
protectorHeath Stewart14-May-04 2:16 
GeneralUserControl and how to add controls to it Pin
Boaz V13-May-04 1:24
Boaz V13-May-04 1:24 
GeneralRe: UserControl and how to add controls to it Pin
Boaz V13-May-04 1:34
Boaz V13-May-04 1:34 
GeneralRe: UserControl and how to add controls to it Pin
Boaz V13-May-04 2:09
Boaz V13-May-04 2:09 
GeneralRe: UserControl and how to add controls to it Pin
sreejith ss nair13-May-04 2:50
sreejith ss nair13-May-04 2:50 
GeneralRe: UserControl and how to add controls to it Pin
Heath Stewart13-May-04 3:38
protectorHeath Stewart13-May-04 3:38 
GeneralRe: UserControl and how to add controls to it Pin
Boaz V13-May-04 3:48
Boaz V13-May-04 3:48 
GeneralCreating Installation Package for a C# Application with web reference Pin
koosala13-May-04 1:22
koosala13-May-04 1:22 
GeneralRe: Creating Installation Package for a C# Application with web reference Pin
Aryadip13-May-04 1:49
Aryadip13-May-04 1:49 
GeneralRe: Creating Installation Package for a C# Application with web reference Pin
koosala14-May-04 0:31
koosala14-May-04 0:31 
GeneralRe: Creating Installation Package for a C# Application with web reference Pin
Heath Stewart13-May-04 2:00
protectorHeath Stewart13-May-04 2:00 
GeneralRe: Creating Installation Package for a C# Application with web reference Pin
Anonymous18-May-04 4:35
Anonymous18-May-04 4:35 
GeneralThread problem Pin
michael.wikstrom13-May-04 1:08
michael.wikstrom13-May-04 1:08 
GeneralUsercontrol Problem Pin
Anfernius12-May-04 23:43
Anfernius12-May-04 23:43 
GeneralRe: Usercontrol Problem Pin
Aryadip13-May-04 0:10
Aryadip13-May-04 0:10 
GeneralRe: Usercontrol Problem Pin
Anfernius13-May-04 0:55
Anfernius13-May-04 0:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.