Problem initiating DirectSound
Problem initiating DirectSound
Problem initiating DirectSound
Problem initiating DirectSound
Problem initiating DirectSound
Problem initiating DirectSound Problem initiating DirectSound Problem initiating DirectSound Problem initiating DirectSound Problem initiating DirectSound Problem initiating DirectSound Problem initiating DirectSound Problem initiating DirectSound
Problem initiating DirectSound Problem initiating DirectSound
Problem initiating DirectSound
Go Back  Xtreme Visual Basic Talk > > > > Problem initiating DirectSound


Reply
 
Thread Tools Display Modes
  #1  
Old 05-31-2010, 11:16 AM
wilkewitz wilkewitz is offline
Newcomer
 
Join Date: Jan 2010
Posts: 12
Default Problem initiating DirectSound


Recently I have been using Mcisendstring to manage all the sounds in a game I am making, however MCI was being retarded, so I decided to switch to Directsound.

I have been following this tutorial to learn the basics about setting up Directsound:
http://gpwiki.org/index.php/VBNETirectSound

my problem is that when I actually initiate a device or initiate a secondary buffer, VB won't load the program to debug it. I will push play, and it will sit there and after a while it will switch out of debug mode.

I have had this same problem when trying to debug without having all of my GIF images in the directory, so it wouldn't load the form and thus my program wouldn't load.

So any suggestions? All the code I'm using should be the same... and I'm Using express 08, Windows 7, and I don't know what version of DX I'm using.

Danke!
Reply With Quote
  #2  
Old 05-31-2010, 11:19 AM
PlausiblyDamp's Avatar
PlausiblyDampProblem initiating DirectSound PlausiblyDamp is offline
Ultimate Contributor

Forum Leader
* Expert *
 
Join Date: Nov 2003
Location: Newport, Wales
Posts: 2,057
Default

Are there any errors thrown? Is there any debug output or diagnostics being sent to the output window?
__________________
Intellectuals solve problems; geniuses prevent them.
-- Albert Einstein

Posting Guidelines Forum Rules Use the code tags
Reply With Quote
  #3  
Old 05-31-2010, 11:34 AM
wilkewitz wilkewitz is offline
Newcomer
 
Join Date: Jan 2010
Posts: 12
Default

Quote:
Originally Posted by PlausiblyDamp View Post
Are there any errors thrown? Is there any debug output or diagnostics being sent to the output window?
I can force an error (invalid operation exception) by using
Dim dev As Device = New Device
in the declarations instead of
Dim dev as Device

but either way I can't put
dev = new Device
in the form load

I'm guessing the problem is that some sort of DX file isn't where it should be so VB can't find it, so I'm gonna download the latest DX again.
Reply With Quote
  #4  
Old 05-31-2010, 01:21 PM
wilkewitz wilkewitz is offline
Newcomer
 
Join Date: Jan 2010
Posts: 12
Default

Also, one other thing. I just created a new project just to see if I could get Dsound working on that, and the first time I ran it, it did the same thing where the mainform didn't show, and then it backed out, but this time it gave me a message:

((Program Compatability Assistant)
Windows detected that this program did not run correctly
to try and fix the problem, Windows has applied compatibility settings to this program. Windows will use these settings the next time you run the program.
Try running the program again.)

It gave me that message for this new project, and my game I've been working on, and it didn't fix the problem for either. Also, I have seen this message before and usually it does fix problems, just not for DX.

Not sure if that helps you....
Reply With Quote
  #5  
Old 05-31-2010, 03:40 PM
wilkewitz wilkewitz is offline
Newcomer
 
Join Date: Jan 2010
Posts: 12
Default

Another update, when I added the code that prevents it from running, I tried opening the application from the bin\debug folder, and I got an error message:

(unhandled exception)
System.BadImageFormatException: is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)
at Theta_3._0.Gameform.Gameformload(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Reply With Quote
  #6  
Old 05-31-2010, 04:19 PM
PlausiblyDamp's Avatar
PlausiblyDampProblem initiating DirectSound PlausiblyDamp is offline
Ultimate Contributor

Forum Leader
* Expert *
 
Join Date: Nov 2003
Location: Newport, Wales
Posts: 2,057
Default

Are you running on a 64 bit system by any chance? If so set the project to target x86 and this error should be resolved.
__________________
Intellectuals solve problems; geniuses prevent them.
-- Albert Einstein

Posting Guidelines Forum Rules Use the code tags
Reply With Quote
  #7  
Old 05-31-2010, 05:47 PM
wilkewitz wilkewitz is offline
Newcomer
 
Join Date: Jan 2010
Posts: 12
Default

I actually don't know... I've always assumed that 32 bit is normal, is that right? and if I'm not running 32 bit then is there a way to switch to it if it is normal?

I will check, and then try that.
Reply With Quote
  #8  
Old 05-31-2010, 06:21 PM
wilkewitz wilkewitz is offline
Newcomer
 
Join Date: Jan 2010
Posts: 12
Default

Ok, I did that and I was able to get further into the build, (past initiating the device and buffers) however switching the target created a new problem.

Now the first arraylist that is run throws an error (null reference exception)
In the first case that this occurs, I am using a for each loop to go through a bunch of rectangles... but it will happen to any other arraylist if I mark that one out.

This did not happen before I switched the target...
Reply With Quote
  #9  
Old 05-31-2010, 06:24 PM
PlausiblyDamp's Avatar
PlausiblyDampProblem initiating DirectSound PlausiblyDamp is offline
Ultimate Contributor

Forum Leader
* Expert *
 
Join Date: Nov 2003
Location: Newport, Wales
Posts: 2,057
Default

Changing the target type shouldn't alter how an ArrayList works, then again from what you said it was crashing before this point anyway...

When you declare your ArrayLists are you assigning a new instance of the ArrayList class to the variable?
__________________
Intellectuals solve problems; geniuses prevent them.
-- Albert Einstein

Posting Guidelines Forum Rules Use the code tags
Reply With Quote
  #10  
Old 05-31-2010, 06:32 PM
wilkewitz wilkewitz is offline
Newcomer
 
Join Date: Jan 2010
Posts: 12
Default

....Hey, originally I would declare them like
dim platforms as arraylist

but when I added = new arraylist to the end of the first problematic one, then that arraylist was skipped and the next one threw the error. I will go through them all and see if that solves this.

One more question, what exactly does changing the target do? will it alter the way my program runs on other computers?
Reply With Quote
  #11  
Old 05-31-2010, 06:44 PM
wilkewitz wilkewitz is offline
Newcomer
 
Join Date: Jan 2010
Posts: 12
Default

Dude, I'm getting a plethora of similar problems, and I don't know how to fix all of them...

after add "= new arraylist" to all my array declarations, I now get a nullreference with my bitmaps

most of my variables start off as null, and I give them values before I use them. will this cause trouble when the target is changed to x86?
Reply With Quote
  #12  
Old 05-31-2010, 06:48 PM
wilkewitz wilkewitz is offline
Newcomer
 
Join Date: Jan 2010
Posts: 12
Default

fixed... I just had to add all my resources to the x86 debug folder...

Ok, my problem has been completely resolved, and I have gotten directsound to work.

Thank you!!!!

Last edited by wilkewitz; 05-31-2010 at 07:15 PM. Reason: another post was unnecessary
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Problem initiating DirectSound
Problem initiating DirectSound
Problem initiating DirectSound Problem initiating DirectSound
Problem initiating DirectSound
Problem initiating DirectSound
Problem initiating DirectSound Problem initiating DirectSound Problem initiating DirectSound Problem initiating DirectSound Problem initiating DirectSound Problem initiating DirectSound Problem initiating DirectSound
Problem initiating DirectSound
Problem initiating DirectSound
 
Problem initiating DirectSound
Problem initiating DirectSound
 
-->