Results 1 to 11 of 11

Thread: PC Speaker won't work under Win2k/XP

  1. #1

    Thread Starter
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,236

    PC Speaker won't work under Win2k/XP

    I've had this app for a few years now and under Win9x/ME it always works great. It plays tones through the PC Speaker at various frequencies and durations. Running under WinXP it crashes and wants to send an error report to M$. Under Win2k it crashes and gives a message "Windows is closing this program you need to run it again".

    I can't remember where I had this app from so I can't contact the supplier. I've check the code and is appears to be functioning correctly the API calls are correct. I wonder it any one has used this app or if they can see where the error occurs. I don't have VB6 running under WinXP anymore, they won't install it at work. So I'm open to any useful suggestions.

    Thank you all.

    P.S. I would suggest in Win2k/XP compiling the exe first just to save it crashing VB.
    Attached Files Attached Files
    Last edited by Keithuk; Mar 17th, 2006 at 07:46 PM.
    Keith

    I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

  2. #2
    Frenzied Member d3gerald's Avatar
    Join Date
    Jan 2006
    Posts
    1,348

    Re: PC Speaker won't work under Win2k/XP

    does this application have something like system requirement. some softwares are built for lower versions of OS and wont run in higher verwions. just like msword document made with word35. it cant be opened with word2k. something like that might have happened to this app of yourse
    On error goto Trap

    Trap:
    in case of emergency, drop the case...

    ****************************************
    If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option.
    if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar

  3. #3

    Thread Starter
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,236

    Re: PC Speaker won't work under Win2k/XP

    Quote Originally Posted by d3gerald
    does this application have something like system requirement.
    I don't know, I downloaded it years ago. The API calls should still work on any 32bit system I would have thought.
    Keith

    I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

  4. #4
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: PC Speaker won't work under Win2k/XP

    it bombs out when it tries to turn on the Speaker using CallWindowProc. It uses a hex code to create a MachineCode array and then passes a pointer to the first byte of that array to the function. So perhaps the code to turn on the speaker is different in W2k & XP?

  5. #5
    Frenzied Member d3gerald's Avatar
    Join Date
    Jan 2006
    Posts
    1,348

    Re: PC Speaker won't work under Win2k/XP

    yeah i also experienced that one. i think its a compatibility issue then
    On error goto Trap

    Trap:
    in case of emergency, drop the case...

    ****************************************
    If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option.
    if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar

  6. #6

    Thread Starter
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,236

    Re: PC Speaker won't work under Win2k/XP

    Ok then, does anyone know how to convert it for Win2k/XP?
    Keith

    I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

  7. #7
    Frenzied Member Andrew G's Avatar
    Join Date
    Nov 2005
    Location
    Sydney
    Posts
    1,587

    Re: PC Speaker won't work under Win2k/XP

    Another way to play sounds from the PC speaker

    VB Code:
    1. Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
    2. Dim Freq As Long
    3. Dim Dur As Long
    4.  
    5. Private Sub Command1_Click()
    6.     Freq = 1000
    7.     Dur = 100
    8.    
    9.     Beep Freq, Dur  'Play the sound
    10. End Sub

  8. #8

    Thread Starter
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,236

    Re: PC Speaker won't work under Win2k/XP

    The Beep API doesn't work for me, never as done. I fact the Beep API should be renamed BeepEx or something because it interferes with the default Beep.

    I've found the link to the original PC Speaker.

    http://www.planet-source-code.com/vb...80&lngWId=1%20

    People say it won't work with Win2k/XP. As I said I downloaded a few years ago.
    Keith

    I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

  9. #9
    Junior Member
    Join Date
    Nov 2005
    Posts
    22

    Lightbulb Re: PC Speaker won't work under Win2k/XP

    Hi,

    Have you tried running it in compatibility mode? Right-click the .exe, Properties-->Compatibility...

    domls

  10. #10

    Thread Starter
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,236

    Re: PC Speaker won't work under Win2k/XP

    Quote Originally Posted by domls
    Have you tried running it in compatibility mode? Right-click the .exe, Properties-->Compatibility...
    I don't have WinXP at home, Win98. Well I do have WinXP but I don't like it.
    Keith

    I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

  11. #11
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: PC Speaker won't work under Win2k/XP

    Quote Originally Posted by domls
    Have you tried running it in compatibility mode? Right-click the .exe, Properties-->Compatibility...
    Didn't crash, but didn't make any sounds either.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width