?
Solved

The annoying LPCWSTR in as WinAPI parameter

Posted on 2008-10-09
3
Medium Priority
?
409 Views
Last Modified: 2012-05-05
I'm just trying to launch a message box in visual c++

This does not work....

MessageBox(NULL,TCHAR("test"),(LPCWSTR)"test",NULL);

Help. :-)
0
Comment
Question by:silentthread2k
  • 2
3 Comments
 
LVL 19

Accepted Solution

by:
LordOfPorts earned 2000 total points
ID: 22683156
Visual C++ .NET
MessageBox::Show("Test");

Navtive C++
MessageBox(_T("test"), _T("test"));
0
 

Author Closing Comment

by:silentthread2k
ID: 31504853
It rocks man! Clean, short and to the point!
0
 
LVL 19

Expert Comment

by:LordOfPorts
ID: 22683178
Here is also a reference to the .NET version with various other options such as icons (code is in the lower section of the page:

http://msdn.microsoft.com/en-us/library/system.windows.forms.messagebox.aspx

...and the native Win32 version reference:

http://msdn.microsoft.com/en-us/library/ms645505(VS.85).aspx
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
Integration Management Part 2
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses
Course of the Month15 days, 1 hour left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question