I have built a fun little program that runs perfectly in the Visual Basic IDE but when I publish it there are problems.
First there was an Out Of Range Exception - now fixed. Then the progress bar didn't work - now fixed.
The problem now is the code in the Finally section of my Try...Catch is not running. In the screenshot I have arrowed the line I think may be the problem but I can't figure out what the actual problem is or how to solve it.
Yes Alex you read right - it's a Fart Machine App.
Not sure what I did but it is now partly working. The code is running but too soon. It should only run after the WAV file has stopped playing. And the progress bar has stopped working again. LOL
Still not sure why it runs perfect in Visual Studio and not when I publish it. Very weird.
I'll persevere after a well deserved break.
It is on GitHub here: https://github.com/VB1975/Fart-Machine
I haven't done much with Visual Studio in YEARS, but I know that my VBA PlaySound code has an option to play synchronously or asynchronously. See Microsoft's site.
Kevin RobertsonOP
@Reply 4 years ago
I finally figured out that when I set the configuration to Release the length of the WAV file wasn't being returned (not sure why). Thanks to my old friend MessageBox for helping me out there. LOL
I hard coded the length of each, since they won't change, and it now works as it should.
Must be something to do with the function, which I found online.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Visual Basic Forum.