VB .Net and DirectX

I'm new in DirectX, just starting now, and i'm following the code that i see
in books. I'm trying to use a code from a book but i get an error message
that i can't solve (and it souldn't be appening)
whenever i click the button1 i get an error message in the following line of
For i = 0 To Microsoft.DirectX.Direct3D.Manager.Adapters.Count - 1

i get this error message (error message has been translated to English)
is trying the execution managed inside the blockade of the Shipment Program
of the SO. Do not try to execute the code managed inside DllMain or an image
initialization function, because that might make the application to be

my source code is this

Public Class Form1
Dim ObjDirect3DDevice As Microsoft.DirectX.Direct3D.Device

Private Sub ListAdapters()
Dim i As Integer
Dim AdapterInfo As Microsoft.DirectX.Direct3D.AdapterDetails

For i = 0 To Microsoft.DirectX.Direct3D.Manager.Adapters.Count - 1
AdapterInfo =

lstAdapters.SelectedIndex = 0
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
End Sub
End Class

Can you help me?

My thanks in advanced
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!