Thread: Accessing hardware directly (equivalent) in XP

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    417

    Accessing hardware directly (equivalent) in XP

    I've been working on a program on a Windows 2k computer, its a console application. It won't do anything at my home computer (running windows XP) because it uses the beep() function to access the PC speaker directly.

    Now, since I'm using XP and it doesn't like my accessing the PC speaker directly, is there some other function or some way to make it beep different tones in XP (other than installing the DOS files like command.com)?

    Thanks!

  2. #2
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    Beep() works fine on my XP system.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  3. #3
    Registered User
    Join Date
    Sep 2002
    Posts
    417
    Really... it doesn't give an error, but it won't play any tones. I'm using MVC++ 6.0, but that shouldn't matter.

  4. #4
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    Irritating, but perfectly functional...

    Code:
    #include <windows.h>
    
    int main()
    {
    	Beep (523, 500);
    	Beep (587, 500);
    	Beep (659, 500);
    	Beep (698, 500);
    	Beep (784, 500);
    	Beep (880, 500);
    	Beep (988, 500);
    	Beep (1047, 500);
    	return 0;
    }
    ... does your internal speaker ever beep, i.e. do you have one, is it connected etc...

    *** EDIT ***

    Also MS VC++ 6.0 Pro.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  5. #5
    Registered User
    Join Date
    Sep 2002
    Posts
    417
    Yes, I have one. I also have regular speakers.

    One quick question: do you have a sound card?

  6. #6
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    From memory, there is an onboard sound chip on the mother board I have, never used it. The speakers connected to the system are turned off, (only ever used to listen to cricket commentary streaming from where ever a match is going on!).

    I cannot believe that is significant. The SDK docs would say if it had been replaced in XP.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  7. #7
    Registered User
    Join Date
    Sep 2002
    Posts
    417
    Hmm. I forgot to mention that it doesn't make any noise at all.

  8. #8
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    What, ever? When you boot does the internal speaker beep at all, (speakers switched off)? What I'm trying to find out is if, in fact, your internal speaker is working - you say you have one - are you sure it works?
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Accessing Hardware Protected Mode
    By valaris in forum Tech Board
    Replies: 9
    Last Post: 02-15-2009, 08:56 AM
  2. Replies: 6
    Last Post: 05-15-2007, 10:47 PM
  3. Windows XP regression over time
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 12-17-2002, 10:49 AM
  4. Replies: 2
    Last Post: 11-14-2001, 09:19 PM
  5. Accessing memory directly
    By YALINI in forum C Programming
    Replies: 0
    Last Post: 08-30-2001, 11:56 PM