Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Calling win32 functions from MFC code

1 view
Skip to first unread message

Sergey

unread,
Oct 30, 2000, 9:04:34 AM10/30/00
to

HI ALL!
I try to call winapi function messagebox in mfc code.
VC++6 compiler shows following error:
'error C2660: 'MessageBoxA' : function does not take 4 parameters'
but it has 4 parameters and in win32 code all works fine.
It's not a problem to output message - AfxMessageBox is
a proper function, but I need to use win32 functions.
Maybe there are some calling rules for win32 functions,
calling from mfc ?

THANK YOU IN ADVANCE

--
Best regards
Sergey


dave porter

unread,
Oct 30, 2000, 12:05:35 PM10/30/00
to
This is a C++ scope problem, and is not in itself
anything to do with MFC. There is simply more than
one implementation of MessageBox in scope.

Use the C++ scope resultion operator '::'

MessageBox(); // in a subclass of CWnd, refers to CWnd::MessageBox

::MessageBox(); // always refers to the global MessageBox

dave
--
remove 'z' from my email address


"Sergey" <Dr-...@mail.ru> wrote in message
news:#k7kJLoQ...@cppssbbsa02.microsoft.com...

0 new messages