Solved

The annoying LPCWSTR in as WinAPI parameter

Posted on 2008-10-09
3
378 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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

912 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now