473,503 Members | 3,247 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::InteropServices;

namespace WavAPI
{
[DllImport("winmm.dll")]
extern "C" bool sndPlaySound(String* 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 7239
"aunthas" <pp*********@hotmail.com> wrote in message
news:6b******************************@localhost.ta lkaboutsoftware.com...

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

-------------------------------------------------------------------------------------------------------------------
using namespace System;
using namespace System::Runtime::InteropServices;

namespace WavAPI
{
[DllImport("winmm.dll")]
extern "C" bool sndPlaySound(String* 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::InteropServices 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::InteropServices::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***********************@hotmail.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
2713
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......
5
2538
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...
0
1773
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...
3
7792
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...
9
13241
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...
4
4844
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...
6
16151
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...
3
8166
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 ...
0
2325
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'...
0
7070
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...
1
6976
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...
0
5566
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4993
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...
0
3160
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...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
729
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
372
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...

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.