CFrameWnd::Create Error

Posted on the June 4th, 2008 under Programming by admin

I wanted to try a small MFC project, Igot the following error when i compile.
error C2664: ‘CFrameWnd::Create’ : cannot convert parameter 2 from ‘const char [39]‘ to ‘LPCTSTR’

After searching on the internet, found out the reason is: project is setup to use Unicode. If you use _T macro while using string literals it will work for both the UNICODE and the ANSI string literals. T macro simply redirects to UNICODE or ANSI type.

solution:

Use the TEXT macro:

Create( NULL, TEXT( “MFC Tutorial Part 1 CoderSource Window” ) );

or

Create( NULL, _T(”MFC Fundamentals”));

One Response to 'CFrameWnd::Create Error'

  1. June 7, 2008 at 10:35 am
    myspace design

Leave a Reply




XHTML::
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="">