Click here to Skip to main content
15,924,317 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Guys, this is my code
C#
void Cday1Dlg::OnClickedIdhello()
{
    // TODO: Add your control notification handler code here
      MessageBox(
        NULL,
        (LPCWSTR)L"Resource not available\nDo you want to try again?",
        (LPCWSTR)L"Account Details",MB_OK);
}

I am new to Visual C++, I got this function usage from official microsoft, still getting this error, help me out!
Error:
Error 3 error C2660: 'CWnd::MessageBoxW' : function does not take 4 arguments c:\users\jeevan\documents\visual studio 2010\projects\day1\day1\day1dlg.cpp 171 1 day1
Posted
Comments
Richard MacCutchan 22-Feb-14 5:18am    
Just remove the first parameter (the CWnd pointer), as it is implied in a class inherited from CWnd.

1 solution

Each CWnd has a MessageBox[^] function where the parent of the message box is the CWnd you're calling it from.

If you want to call the global function, make sure you specify the global scope

C++
::MessageBox(NULL, L"Message", L"Title", MB_OK)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900