Cannot Create Device when using DX9.0c

CatholicSchGirl
09-03-2004, 03:06 AM
All,

I just recently downloaded the Microsoft DirectX 9.0 SDK (Summer 2004) and installed it over the previous version Microsoft DirectX 9.0 SDK

Before the update, "C:\WINDOWS\Microsoft.NET\Managed DirectX" contained the following folders:

v9.00.0900
v9.00.1126

Of which only v9.00.0900 worked.

After the update, "C:\WINDOWS\Microsoft.NET\Managed DirectX" contained the following folders:

v9.00.0900
v9.00.1126
v9.02.2904

Before the update, all of my Direct3D applications referenced the DirectX dlls in the v9.00.0900 folder and worked just fine. And all of the samples worked just fine.

After the update, I assumed that I should now reference the DirectX dlls in the v9.02.2904 folders. Of course once I did that, nothing works at all. Also, none of the Microsoft samples work either. They conveniently give me the error message "Could not initialize Direct3d"

I have narrowed the problem down to the create statement. Even an app this simple fails:

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim MyPresentationParameters As Microsoft.DirectX.Direct3D.PresentParameters
Dim MyDevice As Microsoft.DirectX.Direct3D.Device
Try
MyPresentationParameters = New Microsoft.DirectX.Direct3D.PresentParameters()
MyPresentationParameters.Windowed = True
MyPresentationParameters.SwapEffect = SwapEffect.Discard
MyDevice = New Microsoft.DirectX.Direct3D.Device(0, DeviceType.Hardware, Me, CreateFlags.HardwareVertexProcessing, MyPresentationParameters)
Catch d3dExc As Microsoft.DirectX.DirectXException
Debug.WriteLine(d3dExc.ErrorString & " - Form1_Load, Device Creation")
MyDevice = Nothing
Catch exc As Exception
MyDevice = Nothing
Debug.WriteLine(exc.Message & " - Form1_Load, Device Creation")
Finally
If Not MyDevice Is Nothing Then
MyDevice.Dispose()
MyDevice = Nothing
End If
End Try
End Sub

The DX ERROR Code is D3DERR_INVALIDCALL.

If I switch back to referencing the DX dlls from the v9.00.0900 folder, everything works.

(I have read the other post about problems with the DX9 SDK Installs)

Anyone have any ideas? Very frustrated.

(By the way, my OS is XP home and im developing with .NET Studio 2002)

Faith
09-12-2004, 06:56 PM
Your problem might lay just there, I have updated my sdk twice and the directX runtime twice and there is only v9.02.2904 folder in my
C:\WINDOWS\Microsoft.NET\Managed DirectX
There might be some interoperability issues involved, remember to run->dxdiag and check if you have the Debug version installed and the version number is correct
I have the summer update too and I have these values:
DirectX Version: DirectX 9.0c (4.09.0000.0904)

So did you add the default DirectX references from the Add-Reference place in the IDE, (Not the browse button there) I mean did you add Microsoft.DirectX and Microsoft.Direct3D,
if you didn't have those in the references menu then your IDE is bugging.

I'd recommend you get "DirectX Buster" and reinstall the whole directX if problems still continue. Reinstallin' the Ide would not be such a bad thing in that case too.
I remember havin' problems in getting the Microsoft.DirectX references to the Add-References menu, and reinstallin' the IDE and the DX SDK helped me.

CatholicSchGirl
09-13-2004, 12:28 PM
Your problem might lay just there, I have updated my sdk twice and the directX runtime twice and there is only v9.02.2904 folder in my
C:\WINDOWS\Microsoft.NET\Managed DirectX
There might be some interoperability issues involved, remember to run->dxdiag and check if you have the Debug version installed and the version number is correct
I have the summer update too and I have these values:
DirectX Version: DirectX 9.0c (4.09.0000.0904)

So did you add the default DirectX references from the Add-Reference place in the IDE, (Not the browse button there) I mean did you add Microsoft.DirectX and Microsoft.Direct3D,
if you didn't have those in the references menu then your IDE is bugging.

I'd recommend you get "DirectX Buster" and reinstall the whole directX if problems still continue. Reinstallin' the Ide would not be such a bad thing in that case too.
I remember havin' problems in getting the Microsoft.DirectX references to the Add-References menu, and reinstallin' the IDE and the DX SDK helped me.


I have yet to get the managed direct x dlls to show up in the Visual Studio IDE.

I have decided to just go ahead and reformat anyway (its about that time). Do you know of an order of installation that will allow Visual Studio .NET to have the direct X dlls in the add reference dialog?

I typical did them in this order:

Visual Studio .Net
.NET Framework 1.1
Direct X SDK

Thanks for your help

Faith
09-13-2004, 12:32 PM
Like reformatting the whole machine and reinstalling windows too?
What windows?

Faith
09-13-2004, 12:37 PM
I would prefer you set up windows or whatever and then:
Install all service packs and then after this install the Visual Studio.NET and then from within it's autoupdate, the framework 1.1
(if you have XP, framework 1.1 is provided with Service Pack 2, which then is probably not so preferable to install[SP2])
then the MSDN if it exist
then DirectX9.0c Redist
then DirectX9 summer thingie

CatholicSchGirl
09-13-2004, 12:43 PM
Like reformatting the whole machine and reinstalling windows too?
What windows?

Yeah, I'm just gonna wipe the whole thing clean. I use Windows XP Home edition.

Faith
09-13-2004, 12:47 PM
Yeah, I'm just gonna wipe the whole thing clean. I use Windows XP Home edition.
Yea, perhaps it is preferable, go for it and good luck with it, it can be rather tedious sometimes; I remember having the same trouble like 3 or 4 times, you'll catch the drift :)

CatholicSchGirl
09-14-2004, 03:58 PM
Well, I reformatted and reinstalled everything.

I can now create devices and all of the samples and tutorials build and work correctly.

However, the direct x dlls still do not show up in the add references dialog in Visual Studio. Not a big deal, but still a bit annoying.

Thanks for all the help.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum