How to call BOOL Beep( dwFreq, dwDuration ) from managed C++ ?

S

senimu

Hi there,

I'm trying to call very simple API function from managed C++ code

BOOL Beep( DWORD dwFreq, DWORD dwDuration );

Something like this:

namespace DocImage {

public __gc class cBeep {
public:
static bool myBeep(unsigned long iFreq, unsigned long iDur)
{
Beep(iFreq, iDur); return true;
}
};//EOF Class

}

This is the error i'm getting:

c:\src\VC7\Managed\snmKiosk\DocImage\Utils.h(10):
error C3861: 'Beep': identifier not found, even with argument-dependent
lookupC:\Program Files\Microsoft Visual Studio .NET

2003\Vc7\PlatformSDK\Include\WinBase.h(3657): error C2365: 'Beep' :
redefinition; previous definition was a 'formerly unknown identifier'

What's wrong am i doing here?
 
J

Jochen Kalmbach

senimu said:
Hi there,

I'm trying to call very simple API function from managed C++ code

BOOL Beep( DWORD dwFreq, DWORD dwDuration );

c:\src\VC7\Managed\snmKiosk\DocImage\Utils.h(10):
error C3861: 'Beep': identifier not found, even with argument-dependent
lookup

Du solltest ganz oben in deinem CPP-File folgendes hinschreiben:

#include <windows.h>


--
Greetings
Jochen

Do you need a memory-leak finder ?
http://www.codeproject.com/useritems/leakfinder.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top