?
Solved

The annoying LPCWSTR in as WinAPI parameter

Posted on 2008-10-09
3
Medium Priority
?
397 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

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…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

801 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