Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Bug Reports / Enhancements Pack get user name$() crashes if no sound card present

Author
Message
GIDustin
9
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 14th Feb 2014 16:54 Edited at: 14th Feb 2014 17:30
Computer: Dell Optiplex 780
OS: Windows 7 32 Bit
CPU: Inten(R) Core(TM)2 Duo E8400 @ 3.00 GHz, 4.00GB Ram
Video: Intel(R) Q45/Q43 Express Chipset
Sound: "High Definition Audio Device"


Yup, one of those bugs that cause you to tear apart your code looking for the one line that causes it to crash, and find out that the error has nothing to do with the command that causes it.

The full source code of my program (Warning, it is very large)
+ Code Snippet

Running that code on a computer with no sound card, or a computer with a sound card but with no devices plugged in, causes a "Cannot access sound buffer" crash. How your user name has anything to do with your sound system is unknown to me, and why it took so long to track down.

Screenshot is attached (to prove it happened) Both devices (front and rear audio port) claim no device is plugged in, and I get the error. As soon as I plug in headphones, and one of those turns green, the error stops. The sad part is that my application does not use any sound commands at all.




get installed memory(1), also in the enhancements pack, seems to cause the same error. I wonder if it is enhancements in general...

Attachments

Login to view attachments
MrValentine
AGK Backer
6
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: Playing
Posted: 10th Jul 2014 00:37 Edited at: 10th Jul 2014 00:53
I can confirm I get the same error when I disable my sound devices with your code...

Just make sure your users have a speaker attached but turned off it not required, but you can always access User32.DLL to grab this information [I think that is the right DLL or I could be wrong...] but if it uses the same method and could likely be, then you will have the same error either way...

Considering most users will have speakers attached [Specially in the case of laptops, you can brush this aside as a user issue, but again see if using the Windows DLL's to grab this data gets you around this problem...

Just be sure to use proper methods to deal with the DLL loading and deleting it from memory when not in use...

I think this can be marked as accepted/confirmed but I cannot see a fix for Enhancements unless it is an internal TGC product as I am unsure who the developer is right now...

FURTHER

According to this post http://www.codeproject.com/Articles/2308/Get-The-User-Name-In-C-For-NT-Authentication it appears as the DLL is "advapi32.dll" and the information is held in "GetUserNameA"...

FURTHER

A quick search on the forum for "user32.dll for username" in forum search brought about http://forum.thegamecreators.com/?m=forum_view&t=53276&b=18 as a first result and it uses

"" Useful Windows DLL functions (Kernel32.dll, User32.dll, Advapi32.dll)""

Hope this helped

Please post back if this fixed the issue, I am avoiding using DLL's in DBPro at the moment...

EDIT

get installed memory(1), Also confirmed when disabling sound ports...

But I think I have seen this issue outside Enhancements Pack, I could be wrong again but hope I helped here...

Again you could perform this check for installed memory using system DLL's there is actually one that is capable of checking for above 4096 on systems that have more than this using a batch file, cannot remember who posted it but I am sure it is inside the last 250 posts on DBPro discussion board... so check the last 300 for Memory related posts, I tried but failed to find it so up to you...

But I did find this post http://forum.thegamecreators.com/?m=forum_view&t=122729&b=1 which might help somewhat... by accessing the registry...

found that link using "using a DLL to read system memory" it was the first result for me...

Login to post a reply

Server time is: 2017-11-18 08:36:49
Your offset time is: 2017-11-18 08:36:49