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