473,395 Members | 1,386 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

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?

--
Regards,
Sergey Muschin
Nov 16 '05 #1
1 5355
senimu wrote:
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
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: bill_m | last post by:
Has anyone tried to use the .NET Beep function? The following works in VBA: Private Declare Function Beep Lib "Kernel32.dll" _ (ByVal X As Long, ByVal Y As Long) As Long Dim blVal As...
0
by: senimu | last post by:
Hi there,I'm trying to call from managed C++ code very simple API functionBOOL Beep( DWORD dwFreq, DWORD dwDuration );Something like this:namespace DocImage { public __gc class cBeep { ...
1
by: Tim Rogers | last post by:
We've currently got a C++ client/server app that uses DCOM in order to make remote calls. We want to replace DCOM with a .NET Web Service. The server piece seems clear to me. I can write it...
1
by: Jesse McGrew | last post by:
Hi all, I'm trying to make a plugin DLL for a third-party application, using VC++ .NET 2003. This DLL acts as a bridge between the C++ plugin API of the application, and my actual plugin code...
3
by: Steve Marsden | last post by:
Hi I am an experienced C programmer and we have a large app written in C which I have just recompiled with /clr to start to add in managed code to use .NET framework and windows forms bit by...
1
by: bonk | last post by:
Hello, I am trying to create a c++ dll or lib (not COM) that contains a little bit of managed code and a lot of unmanged code using c++/CLI. Basically some classes rely on managed bits...
2
by: Haroon_Saeed | last post by:
Hey, I wrote a managed c++ class library in viusal studio 2005. This managed c++ dll calls native C++ methods of an SDK. When I referenced this managed c++ library in a console applciation...
9
by: Amit Dedhia | last post by:
Hi All I have a VC++ 2005 MFC application with all classes defined as unmanaged classes. I want to write my application data in xml format. Since ADO.NET has buit in functions available for...
10
by: =?Utf-8?B?UmF2aSBTaGFua2Fy?= | last post by:
Hi, I have a requirement where I need to call methods written in VB.Net from a C++ code. I have been going crazy reading various articles on the net w.r.t interop and marshalling but an more...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.