C++ MFC

Moderators: Lundin
Number of threads: 3354
Number of posts: 9032

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
I use Visual studio 2k5 Posted by doanhanam on 15 Oct 2008 at 9:31 PM
in the book that I read in the first lesson teaching how to write a simple MFC program showing the dialogue , they use AfxMessageBox("htl"); but when i type in code it generates error "none of the 2 overloads could convert all the argument types " I know that require 2 parameters . But how to do it correctly . In my university , we study C sharp but i like MFC than and I learn it by my self and with your help .
Thank you .
Report
Re: I use Visual studio 2k5 Posted by Malcolm_McLean on 16 Oct 2008 at 1:13 AM
: in the book that I read in the first lesson teaching how to
: write a simple MFC program showing the dialogue , they use
: AfxMessageBox("htl"); but when i type in code it generates error
: "none of the 2 overloads could convert all the argument types " I
: know that require 2 parameters . But how to do it correctly . In my
: university , we study C sharp but i like MFC than and I learn it by
: my self and with your help .
: Thank you .
:
Are you sure the error is for this call?
It might be that you have set strings to Unicode or vice-versa. The function takes 3 parameters but two have defaults.
Report
Re: I use Visual studio 2k5 Posted by AsmGuru62 on 16 Oct 2008 at 3:30 AM
: : in the book that I read in the first lesson teaching how to
: : write a simple MFC program showing the dialogue , they use
: : AfxMessageBox("htl"); but when i type in code it generates error
: : "none of the 2 overloads could convert all the argument types " I
: : know that require 2 parameters . But how to do it correctly . In my
: : university , we study C sharp but i like MFC than and I learn it by
: : my self and with your help .
: : Thank you .
: :
: Are you sure the error is for this call?
: It might be that you have set strings to Unicode or vice-versa. The
: function takes 3 parameters but two have defaults.
:
By default any new project you create with VC 2005 has an option to use UNICODE text. Simply use L modifier for your strings in quotes:
AfxMessageBox (L"Hello!");
Report
Re: I use Visual studio 2k5 Posted by doanhanam on 18 Oct 2008 at 4:42 AM

Yes , I got the right solution . This is thank to your experience . Thank and have good weekend !



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.