Pointers

rifter1818

Junior Contributor
Joined
Sep 11, 2003
Messages
255
Location
A cold dark place
Im trying to get a pointer to a Device, actually trying to get an intPtr, but...
so far as close as i could get is
[C#]
// With Dev being the device i want to point at
Device* pDev = &Dev;
void* vDev = pDev;
IntPtr X = new IntPtr(vDev);
return X;
[/C#]
Which of course Crashes as you cant get a pointer to a managed object or something like that (first line is wrong...) so folks how do i do it?
 
[C++]
IDirect3DDevice9 *dev = (IDirect3DDevice9*)device->GetObjectByValue(-759872593).ToPointer();
[/C++]

Don't change the number!

I'm not sure if you can do the same in C#. You can get the IntPtr, but I'm not sure how you'll call functions on it.
 
Back
Top