A Riddle: Why does this line doesn't compile

G

Guest

Line:
********
HRESULT CMngdServer::IServerSink::OnReceive(System::IntPtr pbtBuf)
{
void *pBtData = (void*)System::IntPtr::blush:p_Explicit(pbtBuf);// <-- Produce the error
}

The output:
************
error C2668: 'System::IntPtr::blush:p_Explicit' : ambiguous call to overloaded function
could be '__int64 System::IntPtr::blush:p_Explicit(System::IntPtr)'
or 'int System::IntPtr::blush:p_Explicit(System::IntPtr)'
or 'void *System::IntPtr::blush:p_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
 
C

cody

Maybe you shouldn't call the operator explicitly instead you simply invoke
it by casting: (void*).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top