VS does not support getting window handles (go) through AfxGetMainWnd ()

Source: Internet
Author: User

Problem:

In VC6, this code goes through, and the executable

:: Setdlgitemtext (AfxGetMainWnd (), m_hwnd,idc_time,strtime);

(This is the dialog in the program, the code in a global thread function, set the contents of an edit box).

?

But the same code, the same programming environment in the VC8, this code is not OK. First is the run error (compile also can), I estimate the first parameter may be the problem, and because this is a global function in the code setdlgitemtext is prompted should be replaced with SETDLGITEMTEXTW.

?

Excuse me, how can I change the code in this situation?

Answer:

:: Setdlgitemtext (AfxGetMainWnd ()->m_hwnd,idc_time,strtime);

?

Change to this: Setdlgitemtext (AfxGetApp ()->m_pmainwnd->m_hwnd,idc_time, strtime);

?

Minor changes VC2005 does not support AfxGetMainWnd ()->m_hwnd to get the HWND

Problem:

In VC6, this code goes through, and the executable

:: Setdlgitemtext (AfxGetMainWnd (), m_hwnd,idc_time,strtime);

(This is the dialog in the program, the code in a global thread function, set the contents of an edit box).

?

But the same code, the same programming environment in the VC8, this code is not OK. First is the run error (compile also can), I estimate the first parameter may be the problem, and because this is a global function in the code setdlgitemtext is prompted should be replaced with SETDLGITEMTEXTW.

?

Excuse me, how can I change the code in this situation?

Answer:

:: Setdlgitemtext (AfxGetMainWnd ()->m_hwnd,idc_time,strtime);

?

Change to this: Setdlgitemtext (AfxGetApp ()->m_pmainwnd->m_hwnd,idc_time, strtime);

?

Minor changes VC2005 does not support AfxGetMainWnd ()->m_hwnd to get the HWND

?

Problem:

In VC6, this code goes through, and the executable

:: Setdlgitemtext (AfxGetMainWnd (), m_hwnd,idc_time,strtime);

(This is the dialog in the program, the code in a global thread function, set the contents of an edit box).

?

But the same code, the same programming environment in the VC8, this code is not OK. First is the run error (compile also can), I estimate the first parameter may be the problem, and because this is a global function in the code setdlgitemtext is prompted should be replaced with SETDLGITEMTEXTW.

?

Excuse me, how can I change the code in this situation?

Answer:

:: Setdlgitemtext (AfxGetMainWnd ()->m_hwnd,idc_time,strtime);

?

Change to this: Setdlgitemtext (AfxGetApp ()->m_pmainwnd->m_hwnd,idc_time, strtime);

?

Minor changes VC2005 does not support AfxGetMainWnd ()->m_hwnd to get the HWND

?

Problem:

In VC6, this code goes through, and the executable

:: Setdlgitemtext (AfxGetMainWnd (), m_hwnd,idc_time,strtime);

(This is the dialog in the program, the code in a global thread function, set the contents of an edit box).

?

But the same code, the same programming environment in the VC8, this code is not OK. First is the run error (compile also can), I estimate the first parameter may be the problem, and because this is a global function in the code setdlgitemtext is prompted should be replaced with SETDLGITEMTEXTW.

?

Excuse me, how can I change the code in this situation?

Answer:

:: Setdlgitemtext (AfxGetMainWnd ()->m_hwnd,idc_time,strtime);

?

Change to this: Setdlgitemtext (AfxGetApp ()->m_pmainwnd->m_hwnd,idc_time, strtime);

?

Minor changes VC2005 does not support AfxGetMainWnd ()->m_hwnd to get the HWND

Problem:

In VC6, this code goes through, and the executable

:: Setdlgitemtext (AfxGetMainWnd (), m_hwnd,idc_time,strtime);

(This is the dialog in the program, the code in a global thread function, set the contents of an edit box).

?

But the same code, the same programming environment in the VC8, this code is not OK. First is the run error (compile also can), I estimate the first parameter may be the problem, and because this is a global function in the code setdlgitemtext is prompted should be replaced with SETDLGITEMTEXTW.

?

Excuse me, how can I change the code in this situation?

Answer:

:: Setdlgitemtext (AfxGetMainWnd ()->m_hwnd,idc_time,strtime);

?

Change to this: Setdlgitemtext (AfxGetApp ()->m_pmainwnd->m_hwnd,idc_time, strtime);

?

Minor changes VC2005 does not support AfxGetMainWnd ()->m_hwnd to get the HWND

Problem:

In VC6, this code goes through, and the executable

:: Setdlgitemtext (AfxGetMainWnd (), m_hwnd,idc_time,strtime);

(This is the dialog in the program, the code in a global thread function, set the contents of an edit box).

?

But the same code, the same programming environment in the VC8, this code is not OK. First is the run error (compile also can), I estimate the first parameter may be the problem, and because this is a global function in the code setdlgitemtext is prompted should be replaced with SETDLGITEMTEXTW.

?

Excuse me, how can I change the code in this situation?

Answer:

:: Setdlgitemtext (AfxGetMainWnd ()->m_hwnd,idc_time,strtime);

?

Change to this: Setdlgitemtext (AfxGetApp ()->m_pmainwnd->m_hwnd,idc_time, strtime);

?

Minor changes VC2005 does not support AfxGetMainWnd ()->m_hwnd to get the HWND

VC6 and VS2005 a problem!!!

?

Problem:

In VC6, this code goes through, and the executable

:: Setdlgitemtext (AfxGetMainWnd (), m_hwnd,idc_time,strtime);

(This is the dialog in the program, the code in a global thread function, set the contents of an edit box).

But the same code, the same programming environment in the VC8, this code is not OK. First is the run error (compile also can), I estimate the first parameter may be the problem, and because this is a global function in the code setdlgitemtext is prompted should be replaced with SETDLGITEMTEXTW.

Excuse me, how can I change the code in this situation?

Answer:

:: Setdlgitemtext (AfxGetMainWnd ()->m_hwnd,idc_time,strtime);

Change to this: Setdlgitemtext (AfxGetApp ()->m_pmainwnd->m_hwnd,idc_time, strtime);

Minor changes VC2005 does not support AfxGetMainWnd ()->m_hwnd to get the HWND

VS does not support getting window handles (go) through AfxGetMainWnd ()

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.