Workaround for Afxwin1.inl line:21 error with cwnd::create () function

Source: Internet
Author: User

When I recently debugged a DLL, there was an inexplicable assertion error that when a control was created in the main program that was exported by an MFC extension DLL (the control inherits from the CWnd Class), a call to the Create () function appears with the following assertion error:



Debug follow in:

File:afxwin1.inl

Line:21

The following assertion statement was found to be an error:

_afxwin_inline hinstance AFXAPI AfxGetResourceHandle ()
{

ASSERT (Afxcurrentresourcehandle! = NULL);// error here!
return afxcurrentresourcehandle;

}

A lot of trouble to solve, in fact, is made a very low-level error, DLL character set mismatch, MFC DLL character set is Unicode, but I call the Create () function simultaneous into the window named ANSI character set, so does not match!


Workaround for Afxwin1.inl line:21 error with cwnd::create () function

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.