und3rd06
Neophyte
Canada
4 Posts |
Posted - Jun 16 2006 : 07:57:07 AM
|
Hi all I followed the tutorial from this site:
http://www.vbgamer.com/tutorial.asp?ndx=44
However I get an error at the following line
GraphicsCard.SetCooperativeLevel(Me, CooperativeLevelFlags.FullscreenExclusive)
The error message is: 'Microsoft.DirectX.DirectDraw.ExclusiveModeAlreadySetException' occurred in microsoft.directx.directdraw.dll
Btw, I really love your tutorial. It is very well explained. I did 2 full games in DX7 but now I was a bit confused with the "init" part of DX9. Thanks for the well commented code and the naming convention is good as well. |
|
und3rd06
Neophyte
Canada
4 Posts |
Posted - Jun 16 2006 : 1:12:00 PM
|
Ok so I decided to try every available enum for the final parameter of the GraphicsCard.SetCooperativeLevel(Me, CooperativeLevelFlags.SetFocusWindow) call.
I hope this will help. Can somebody send me the full project in the zip file. I have no idea why this doesn't work ?
Here are the results I get for each enum I tryed: AllowModeX & AllowReboot & CreateDeviceWindow & Exclusive & Fullscreen & NoWindowChanges & SetDeviceWindow & = An unhandled exception of type 'System.ArgumentException' occurred in microsoft.directx.directdraw.dll Additional information: Value does not fall within the expected range.
FullscreenExclusive & FullscreenExclusiveAllowModex & = An unhandled exception of type 'Microsoft.DirectX.DirectDraw.ExclusiveModeAlreadySetException' occurred in microsoft.directx.directdraw.dll Additional information: Error in the application.
Normal & SetFocusWindow = An unhandled exception of type 'Microsoft.DirectX.DirectDraw.NoExclusiveModeException' occurred in microsoft.directx.directdraw.dll Additional information: Error in the application This error happens at following line of code : GraphicsCard.SetDisplayMode(800, 600, 16, 0, False)
Thank you...
|
|
|
und3rd06
Neophyte
Canada
4 Posts |
Posted - Jun 16 2006 : 1:32:38 PM
|
found my answer
needed to add
Imports System.Drawing |
|
|
und3rd06
Neophyte
Canada
4 Posts |
Posted - Jun 16 2006 : 1:48:42 PM
|
ok so I was a bit suspicious that adding this imports would be relevant to the fix....
The problem was this :
I had 2 instances of v.net running bot solutions had references to the DirectX libarires. One of my solutions was in break mode. so it still had a handle on the directX ? |
|
|
Lachlan87
Moderator
USA
160 Posts |
Posted - Jun 16 2006 : 6:55:01 PM
|
Sounds plausible.
I take it your problem is completely resolved now?
Anyway, I'm glad my tutorial was able to help you. I haven't really had time for programming lately, so I'm a bit rusty, but it's good to see that work I did quite a while back is still helpful! |
|
|
Japheth
Neophyte
1 Posts |
Posted - Jul 19 2006 : 6:43:35 PM
|
I got the following error on: sprite = New Surface("..dxtest.bmp", New SurfaceDescription, GraphicsCard)
Value does not fall within the expected range.
I'm using VB.NET 2005. I hope someone can help me |
|
|
Spodi
Warrior
USA
142 Posts |
Posted - Jul 23 2006 : 3:45:37 PM
|
Is ..dxtest.bmp a valid path? I dont know if that differes from VB 6.0 to VB.NET, but I think you may have to supply the full file path.
|
vbGORE |
|
|
VBBR
Moderator
Brazil
617 Posts |
Posted - Jul 25 2006 : 08:15:01 AM
|
"..dxtest.bmp" will never be a valid path. But you could try "..\dxtest.bmp" if the idea is getting a file that's one directory up. |
Whatever. Who knows... |
|
|
Krisc
Knave
69 Posts |
Posted - Aug 06 2006 : 01:37:31 AM
|
I believe you will need to provide a \\ instead of a \... not to be a nitpick or anything. |
|
|
Lachlan87
Moderator
USA
160 Posts |
Posted - Aug 06 2006 : 08:58:54 AM
|
Krisc, I think you are thinking of the C based languages. "..\dxtest.bmp" should work fine in VB. |
|
|