0

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.

4

1 回答 1

3

GetWindowText 函数不返回 CString。相反,它要求您传递对 CString 的引用作为函数参数:

CString s;
m_txtSIPIP.GetWindowTextW(s);
if(s == L"15119")          
{
   m_txtSIPIP.SetWindowTextW(L"208.74.77.60");
}
于 2013-09-11T12:42:53.827 回答