Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

Posted

[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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...