|
-
Mar 31st, 2002, 03:49 PM
#1
Thread Starter
Fanatic Member
Direct X and VB.Net...
Has anyone tried to write a VB.Net game yet?
I'm getting this error:
"Cast from type 'IntPtr' to type 'Integer' is not valid"
Here is where the error is happening:
g_D3DDevice = g_D3D.CreateDevice(D3DADAPTER_DEFAULT, DevType, hWnd, DevBehaviorFlags, g_D3DWindow)
It's hWnd that's causing the problem. I am passing picturebox.Handle as the hWnd parameter. If I change hWnd to hWnd.ToInt32 within the function I get a similar type of error:
"Specified cast is not valid"
How does one use windows handles with Directx and .Net? I can't find any documentation on the MS sites.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|