Start with MFC

Source: Internet
Author: User

I have read some of them.

Problems today

1. The expression must contain a pointer. resolve this issue: Define the variable as the pointer CModallessDlg * m_pModallessDlg;

2, .exe triggers a breakpoint. The picture referenced by that program must be a bitmap BIT, so the png I used fails.
3. There are two dialogs, but the functions in them are different. OnPaint (); is there only one, and the other is not ??

4. This is valid.

Error C2664: "bool cdc: TextOutW (int, int, const CString &)": you cannot convert parameter 3 from "const char [25]" to "const CString &"
1>The reason is as follows: cannot convert from "const char [25]" to "const CString"
1>The constructor of class "ATL: CStringT <BaseType, StringTraits>" is declared as "explicit"

I searched for the answer on the Internet and found that there was a good person who gave me the answer. It turned out to be the difference between the wide character and the character. The solution is to add "L" to the front of the string to be output, indicating that the string to be output is a wide string. I think it is a problem with the function definition.

5. Parameter 5 cannot be converted from "const char [20]" to "LPCTSTR ".

Project-properties-General-Character Set-use multi-Byte Character Set

6. Problem 4. solve the problem, but after setting it according to 5, I have to delete L.

7. extern: int XXX in file 1; // defined in file 2, extern int XXX; // declare that the extern int XXX is added to the header of all files to be referenced; // declare

8. once and for all :::

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.