Click to See Complete Forum and Search --> : DirectX8 in C#


klingler
October 22nd, 2001, 08:58 PM
I am trying to use DirectX8 in C# by referencing the DirectX Visual Basic Library(DxVBLibA). I am having problems with the following snipit of code:


D3DDISPLAYMODE displayMode = new D3DDISPLAYMODE();
Direct3DDevice8 device;

//some code that is working...

device = direct3d8.CreateDevice((int)CONST_D3DCONST.D3DADAPTER_DEFAULT, CONST_D3DDEVTYPE.D3DDEVTYPE_HAL, (int)Handle,(int) CONST_D3DCREATEFLAGS.D3DCREATE_HARDWARE_VERTEXPROCESSING, ref presentParameters);




The problem seems to be the passing of presentParameters as a reference through COM. The presentParameters variable is a struct type and I think that is part of the problem. I get an error message box that says: 'System.Runtime.InteropServices.COMException' I have tried boxing it in an object and that didn't work. Does anyone have any ideas?

Thanks,

Kristopher

klingler
October 23rd, 2001, 06:57 PM
I found some solutions on my own, so I thought I would add it to my own post for somebody in the future that faces the same problem. This link has a few work arounds you might try:

http://aspn.activestate.com/ASPN/Mail/Message/DevelopMentor-dotNET-Advocacy/710132

Good luck!

Krisotopher

Shaique
November 12th, 2001, 04:41 PM
Could i do C# programming for the XBox Environment ?

WillemM
October 12th, 2002, 01:19 PM
Is it possible to develop for the Xbox ?
I thought that the Xbox needed special code for games.
I might be wrong, but I don't think C# is used to program for the Xbox