Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / January 2005

Tip: Looking for answers? Try searching our database.

'FILETIME': ambiguous symbol

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
aunthas - 29 Jan 2005 11:16 GMT
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?
Larry Brasfield - 29 Jan 2005 11:51 GMT
> I want to play sound using winapi, so I wrote these lines of code:-
>
[quoted text clipped - 18 lines]
>
> 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.

Signature

--Larry Brasfield
email: donotspam_larry_brasfield@hotmail.com
Above views may belong only to me.


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.