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++ / July 2004

Tip: Looking for answers? Try searching our database.

A Riddle: Why does this line doesn't compile

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nadav - 05 Jul 2004 09:03 GMT
Line:
********
HRESULT CMngdServer::IServerSink::OnReceive(System::IntPtr pbtBuf)
{
  void *pBtData = (void*)System::IntPtr::op_Explicit(pbtBuf);// <-- Produce the error
}

The output:
************
error C2668: 'System::IntPtr::op_Explicit' : ambiguous call to overloaded function
could be '__int64 System::IntPtr::op_Explicit(System::IntPtr)'
or       'int System::IntPtr::op_Explicit(System::IntPtr)'
or       'void *System::IntPtr::op_Explicit(System::IntPtr)'
while trying to match the argument list '(System::IntPtr)'

Why is that happening? Why does the compiler produce this kind of error?

Nadav
   http://www.ddevel.com
cody - 05 Jul 2004 16:08 GMT
Maybe you shouldn't call the operator explicitly instead you simply invoke
it by casting: (void*).

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu  || http://www.deutronium.tk
> Line:
> ********
[quoted text clipped - 15 lines]
> Nadav
>     http://www.ddevel.com

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.