user2655792
user2655792

Reputation: 1

MFC Function Call Missing

I am using the MFC Dialog based application. i want that if i will enter the value in numeric format in a textbox control such that 15119. This value will be converted into 208.74.77.60. I am doing the code here but it is giving me the error.

    if(m_txtSIPIP.GetWindowTextW=="15119")          
{
   m_txtSIPIP.SetWindowTextW(L"208.74.77.60");
}

else if(m_txtSIPIP.GetWindowTextW=="75889")
{
    m_txtSIPIP.SetWindowTextW(L"98.158.148.4");
}

else if(m_txtSIPIP.GetWindowTextW=="81441")
{
    m_txtSIPIP.SetWindowTextW(L"65.111.182.114");
}

else if(m_txtSIPIP.GetWindowTextW=="24149")
{
    m_txtSIPIP.SetWindowTextW(L"192.34.20.119");
}

else if(m_txtSIPIP.GetWindowTextW=="11197")
{
    m_txtSIPIP.SetWindowTextW(L"72.249.184.50");
}
else
{
     m_txtSIPIP.SetWindowTextW(L"");
}

It is giving me the error that CWnd::GetWindowTextW': function call missing argument list; use '&CWnd::GetWindowTextW' to create a pointer to member. What should i do to remove this error.

Upvotes: 0

Views: 504

Answers (1)

ScottMcP-MVP
ScottMcP-MVP

Reputation: 10415

The GetWindowText function does not return a CString. Instead, it requires that you pass a reference to a CString as the function parameter:

CString s;
m_txtSIPIP.GetWindowTextW(s);
if(s == L"15119")          
{
   m_txtSIPIP.SetWindowTextW(L"208.74.77.60");
}

Upvotes: 3

Related Questions