473,881 Members | 1,644 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

'FILETIME': ambiguous symbol


I want to play sound using winapi, so I wrote these lines of code:-

-------------------------------------------------------------------------------------------------------------------
using namespace System;
using namespace System::Runtime ::InteropServic es;

namespace WavAPI
{
[DllImport("winm m.dll")]
extern "C" bool sndPlaySound(St ring* lpszSound, unsigned int fuSound);
}
-------------------------------------------------------------------------------------------------------------------

But I got "FILETIME: ambiguous symbol" when I compiled, because FILETIME
is both the member of InteropService

namespace and defined in WinDef.h.

I tried to use #undef FILETIME, but it didn't work. How can I solve this
problem? Or is there another way to play

sound from API?

Nov 17 '05 #1
1 7261
"aunthas" <pp*********@ho tmail.com> wrote in message
news:6b******** *************** *******@localho st.talkaboutsof tware.com...

I want to play sound using winapi, so I wrote these lines of code:-

-------------------------------------------------------------------------------------------------------------------
using namespace System;
using namespace System::Runtime ::InteropServic es;

namespace WavAPI
{
[DllImport("winm m.dll")]
extern "C" bool sndPlaySound(St ring* lpszSound, unsigned int fuSound);
}
-------------------------------------------------------------------------------------------------------------------

But I got "FILETIME: ambiguous symbol" when I compiled, because FILETIME
is both the member of InteropService

namespace and defined in WinDef.h.

I tried to use #undef FILETIME, but it didn't work. How can I solve this
problem? Or is there another way to play

sound from API?

Those lines of code cannot be compiled as shown.
Please provide a minimal code fragment which does
compile and demonstrates your problem.

A fine solution is to not dump the contents of namespace
System::Runtime ::InteropServic es into the same namespace
in which ::FILETIME is defined. It is your misuse of the
'using' directive which leads to your problem(s).

Another solution is to qualify your use of FILETIME with
the scope you intend to use it from, writing either
::FILETIME
or
System::Runtime ::InteropServic es::FILETIME

There was a recent thread here on the very same issue.
If you were the originator of that thread, please do not
come back until you understand the namespace issue,
or become willing to address it in some fashion.

--
--Larry Brasfield
email: do************* **********@hotm ail.com
Above views may belong only to me.
Nov 17 '05 #2

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

Similar topics

3
2740
by: Lee Gillie | last post by:
I have a VS6 project which I brought into VS .NET, and all has been building fine. Then I upgraded to VS 2003 and I have one source which will no longer compile. Any clues? Compiling... DotNetManagedExport.cpp C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlcom.h(5529) : error C2872: 'CONNECTDATA' : ambiguous symbol could be 'C:\Program Files\Microsoft Visual Studio .NET
5
2557
by: rodri rodri via DotNetMonster.com | last post by:
I have done a program with windows forms in "Visual C++". I have implemented a function that returns two values. For example: double functionExample(int parameter, double __gc* result2); And in a header file, I have written this line: using namespace System::Runtime::InteropServices; This line is necessary for key word. But when compiling the project, I get this error:
0
1812
by: gerry.brennan | last post by:
Hi, I have a project which accesses a database via a database interface class which uses #include microsoft library. In the header file for this database class I have a prototype which passes by reference a CRecordset paramater.
3
7834
by: nicolas.hilaire | last post by:
Hi group, when using unmanaged class with my managed app, I've seen errors when including (for example) <windows.h>. One of theses erros is : IDataObject : ambiguous symbol error I've seen somewhere that to avoid this error, i've to remove all "using namespace XXXXX" from .h, and move it to .cpp.
9
13288
by: Prasad | last post by:
HI, I am a beginner in VC++.. I am trying to write a Win32 console application in visual studio.. I am using following header files.. #include <STRING> using namespace std; #include <hash_map>//from Standard template library //and some other headers
4
4861
by: davidk13 | last post by:
My C++/CLI program uses the WinAPI to create a document, and my use of the Rectangle function--BOOL Rectangle (HDC hDC, int nLeft, int nTOP, int nRight, int nBottom--results in a compiler error C2872-'Rectangle':ambiguous symbol. How can I resolve this ambiguity? Thanks, David
6
16197
by: phnimx | last post by:
I'm attempting to migrate a predominately MFC application that I've just inherited from Visual Studio.NET 2003 to Visual Studio 2005. I've managed to clean up a myriad of compile and link errors but I'm stuck on one final problem. Please note that this application compiled/linked and ran just fine out of Visual Studio.NET 2003. Details: It's originally incarnated as an MFC app, i.e. CWinApp, CMultiDocTemplate,
3
8232
by: kartik369 | last post by:
hi while compiling my code im getting these errors: C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinBase.h(4729): error C2872: 'FILETIME' : ambiguous symbol could be 'C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinDef.h(354) : _FILETIME FILETIME' or 'stdafx.cpp(0) : System::Runtime::InteropServices::FILETIME' can anyone let me know how to resolve this...
0
2346
by: dakshayini | last post by:
Hi, I have created one project in Visual studio 2005. For my application i need to put Sleep() function.n i have added the #include <windows.h> Now if i run this i am getting error as' IServiceProvider' : ambiguous symbol Please if any one knows about this let me know.. Actually i have created in one more project with single form n if i include this sleep function it is running properly..if i put the same in my Application i am...
0
9928
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9776
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11100
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10816
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7953
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7111
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5781
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4196
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3225
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.