Post

 Resources 

Console

Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VBGamer
 VBGamer
 error message in tutorial
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

und3rd06
Neophyte

Canada
4 Posts

Posted - Jun 16 2006 :  07:57:07 AM  Show Profile  Reply with Quote
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  Show Profile  Reply with Quote
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...

Go to Top of Page

und3rd06
Neophyte

Canada
4 Posts

Posted - Jun 16 2006 :  1:32:38 PM  Show Profile  Reply with Quote
found my answer

needed to add

Imports System.Drawing
Go to Top of Page

und3rd06
Neophyte

Canada
4 Posts

Posted - Jun 16 2006 :  1:48:42 PM  Show Profile  Reply with Quote
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 ?
Go to Top of Page

Lachlan87
Moderator

USA
160 Posts

Posted - Jun 16 2006 :  6:55:01 PM  Show Profile  Reply with Quote
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!
Go to Top of Page

Japheth
Neophyte

1 Posts

Posted - Jul 19 2006 :  6:43:35 PM  Show Profile  Visit Japheth's Homepage  Reply with Quote
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
Go to Top of Page

Spodi
Warrior

USA
142 Posts

Posted - Jul 23 2006 :  3:45:37 PM  Show Profile  Visit Spodi's Homepage  Send Spodi an AOL message  Click to see Spodi's MSN Messenger address  Send Spodi a Yahoo! Message  Reply with Quote
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
Go to Top of Page

VBBR
Moderator

Brazil
617 Posts

Posted - Jul 25 2006 :  08:15:01 AM  Show Profile  Reply with Quote
"..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...
Go to Top of Page

Krisc
Knave

69 Posts

Posted - Aug 06 2006 :  01:37:31 AM  Show Profile  Visit Krisc's Homepage  Send Krisc an AOL message  Click to see Krisc's MSN Messenger address  Reply with Quote
I believe you will need to provide a \\ instead of a \... not to be a nitpick or anything.
Go to Top of Page

Lachlan87
Moderator

USA
160 Posts

Posted - Aug 06 2006 :  08:58:54 AM  Show Profile  Reply with Quote
Krisc, I think you are thinking of the C based languages. "..\dxtest.bmp" should work fine in VB.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
VBGamer © Go To Top Of Page
This page was generated in 0.12 seconds. Snitz Forums 2000

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.