I am getting a syntax error for this.

Beep( 750, 300 ) ; frequency, duration in milliseconds
Posted on 2004-12-06 06:25:44 by skywalker
Is that assembler ????
Posted on 2004-12-06 06:29:57 by donkey
Is that assembler ????

From MSDN,


The Beep function generates simple tones on the speaker. The function is synchronous; it does not return control to its caller until the sound finishes.

BOOL Beep(
DWORD dwFreq,
DWORD dwDuration


Frequency of the sound, in hertz. This parameter must be in the range 37 through 32,767 (0x25 through 0x7FFF).

Windows Me/98/95: The Beep function ignores this parameter.

Duration of the sound, in milliseconds.

Windows Me/98/95: The Beep function ignores this parameter.

Return Values

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Muting and volume control have no effect on Beep; you will still hear the tone. To silence the tone, use the following commands:

net stop beep
sc config beep start=disabled

Terminal Services: The beep is redirected to the client.

Windows Me/98/95: On computers with a sound card, the function plays the default sound event. On computers without a sound card, the function plays the standard system beep.

Example Code

The following example demonstrates the use of this function.

Beep( 750, 300 );


Client: Requires Windows XP, Windows 2000 Professional, Windows NT Workstation, Windows Me, Windows 98, or Windows 95.
Server: Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server.
Header: Declared in Winbase.h; include Windows.h.
Library: Link to Kernel32.lib.
DLL: Requires Kernel32.dll.
Posted on 2004-12-06 07:32:58 by skywalker
So you mean...

invoke Beep, 750, 300

Works fine for me.
Posted on 2004-12-06 07:36:44 by donkey
So you mean...

invoke Beep, 750, 300

Works fine for me.

Using it, I still get the same message. ???
Posted on 2004-12-06 07:39:23 by skywalker
I am assuming that you are using MASM and have included Kernel32.lib so I tested it in that and GoAsm and it works perfectly fine. You are probably making a typo, make sure the 'B' is capitalized. Beyond that, it works fine so the error is not something that is caused by the assembler, Windows or the linker so you're on your own.
Posted on 2004-12-06 07:47:59 by donkey