VB.NET & DirectX

VB.NET & DirectX

Post by Mark Bonningto » Thu, 20 Jun 2002 13:10:05



I'm attempting to access DirectX functionality via VB.NET.  The following
code is failing, but I havn't been able to figure out why.  Does anyone have
any ideas why it's not working?

The failure occurs during compilation - a single error message ("Additional
information: Element not found") shows up on the last line of the source
code.

'Create DirectX object

Dim oDX As DxVBLib.DirectX7 = New DxVBLib.DirectX7()

Dim oDD As DxVBLib.DirectDraw7

Dim oDDP As DxVBLib.DirectDrawPalette

Dim arPalette(255) As DxVBLib.PALET*TRY

Dim i As Integer

'Define Grey-Scale Palette

For i = 0 To 255

arPalette(i).blue = i

arPalette(i).red = i

arPalette(i).green = i

Next i

'Initialize Palette Surface

oDD = oDX.DirectDrawCreate("")

oDD = oDD.CreatePalette(DxVBLib.CONST_DDPCAPSFLAGS.DDPCAPS_8BIT, arPalette)

 
 
 

VB.NET & DirectX

Post by Patrice Scrib » Thu, 20 Jun 2002 19:27:30


Try perhaps arPalette(0). If I remember the type lib doesn't expect an array
but a pointer on the first cell of the array.

That said, I would strongly recommend testing your ideas under VB6 and
upgrading to .NET once DX9 is out...



Quote:> I'm attempting to access DirectX functionality via VB.NET.  The following
> code is failing, but I havn't been able to figure out why.  Does anyone
have
> any ideas why it's not working?

> The failure occurs during compilation - a single error message
("Additional
> information: Element not found") shows up on the last line of the source
> code.

> 'Create DirectX object

> Dim oDX As DxVBLib.DirectX7 = New DxVBLib.DirectX7()

> Dim oDD As DxVBLib.DirectDraw7

> Dim oDDP As DxVBLib.DirectDrawPalette

> Dim arPalette(255) As DxVBLib.PALET*TRY

> Dim i As Integer

> 'Define Grey-Scale Palette

> For i = 0 To 255

> arPalette(i).blue = i

> arPalette(i).red = i

> arPalette(i).green = i

> Next i

> 'Initialize Palette Surface

> oDD = oDX.DirectDrawCreate("")

> oDD = oDD.CreatePalette(DxVBLib.CONST_DDPCAPSFLAGS.DDPCAPS_8BIT,
arPalette)


 
 
 

VB.NET & DirectX

Post by Mark Bonningto » Thu, 20 Jun 2002 23:30:50


Alas, I tried and the situation did not improved.  Perhaps you are correct
about holding off on .NET until DX9 arrives.  Maybe I'll try some C++ in the
meantime.

Thanks.


> Try perhaps arPalette(0). If I remember the type lib doesn't expect an
array
> but a pointer on the first cell of the array.

> That said, I would strongly recommend testing your ideas under VB6 and
> upgrading to .NET once DX9 is out...



> > I'm attempting to access DirectX functionality via VB.NET.  The
following
> > code is failing, but I havn't been able to figure out why.  Does anyone
> have
> > any ideas why it's not working?

> > The failure occurs during compilation - a single error message
> ("Additional
> > information: Element not found") shows up on the last line of the source
> > code.

> > 'Create DirectX object

> > Dim oDX As DxVBLib.DirectX7 = New DxVBLib.DirectX7()

> > Dim oDD As DxVBLib.DirectDraw7

> > Dim oDDP As DxVBLib.DirectDrawPalette

> > Dim arPalette(255) As DxVBLib.PALET*TRY

> > Dim i As Integer

> > 'Define Grey-Scale Palette

> > For i = 0 To 255

> > arPalette(i).blue = i

> > arPalette(i).red = i

> > arPalette(i).green = i

> > Next i

> > 'Initialize Palette Surface

> > oDD = oDX.DirectDrawCreate("")

> > oDD = oDD.CreatePalette(DxVBLib.CONST_DDPCAPSFLAGS.DDPCAPS_8BIT,
> arPalette)

 
 
 

1. Directx 9 in VB.net, AnimationController

Hi there,

I need create new instance of AnimationController.
After two rows in my code system throws following exception ...
Cannot access a disposed object named
"Microsoft.DirectX.Direct3D.AnimationController"

***My code
Dim MyAnimationController As AnimationController
MyAnimationController = New AnimationController(47, 1, 2, 30) 'Here
apears the exception.
***

Does anybody know what I am doing wrong?

Thanks
Pavel

2. presentation pkg for macs/pcs

3. Directx 8 with VB.net

4. play FLI/FLC in Windows

5. wglUseFontOutlines & VB.NET

6. cant find doors!

7. OpenGL & VB.NET

8. How do I bend an image slightly?

9. DX VB.NET Vs DX VC++.NET

10. VB.NET, cards.dll, PictureBox

11. APIs and VB.net

12. Question on CreateDIBSection under VB .Net

13. bitblt in vb.net