473,791 Members | 3,216 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

convert LPCSTR to LPCWSTR?

Neo
how convert LPCSTR to LPCWSTR?

regards,
Mohammad Omer Nasir.
Jun 26 '06 #1
2 7900
Neo wrote:
how convert LPCSTR to LPCWSTR?


See mbstowcs and MultiByteToWide Char in the Visual Studio documentation or
on MSDN.

-cd


Jun 26 '06 #2
Hi Neo!
how convert LPCSTR to LPCWSTR?


In addition to Carls answer; if you have MFC/ATL:

CA2CW
--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Jun 26 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
30226
by: Michael Breidenstein | last post by:
Hi, anybody can help me to convert a "char *" to LPCWSTR with the following function: LPCWSTR charP2LPCWSTR(char *szText){ LPCWSTR tmp; tmp=szText; // At this point I need help
3
14709
by: George Ter-Saakov | last post by:
How do i call from managed C++ function wich accepts LPCSTR? void AddName( System::String *sName ) { AddName( (LPCSTR) sName )); -- does not compile. } George.
8
12166
by: ppcdev | last post by:
Here's what I try : LPCTSTR tst = (LPCTSTR) (LPCWSTR) Marshal::StringToHGlobalUni(str); c:\MyNetPrj\Prj0001\stunt.cpp(244): error C2440: 'type cast' : cannot convert from 'System::IntPtr' to 'LPCWSTR' I really get mad with that !!!
13
5867
by: Joe Thompson | last post by:
Hi, I am using VS 2003 writing a managed C++ windows app. I am calling PlaySound. The first parameter is a LPCSTR. I have a String *str representing a filename. I like using the String class because the file name needs to be built on the fly. How do I get from String * I have to the LPCSTR it wants? I have searched around for this and it seems to be a common question but I can not find a simple answer.
3
3349
by: Maileen | last post by:
Hi, How can we convert string^ to String or to LPCWSTR ? thx, Maileen
4
44377
by: sweety | last post by:
Dear all, Kindy help to convert the char* ( LPCSTR) to WCHAR*(LPCWSTR). Would be great if you tell if any function does this job in VC++. Quick response will be greatfull...as its blocked... Thanks, Sweety
7
3250
by: nicolas.hilaire | last post by:
hi all, i'm using this code to convert a String ^ in char * String ^str = "string .net"; IntPtr p = System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi(str); LPCSTR str2 = reinterpret_cast<LPCSTR>(static_cast<void *>(p)); System::Runtime::InteropServices::Marshal::FreeHGlobal(p);
1
10334
by: asenthil | last post by:
Hai this is senthil... I had tried to write a string which fetched from a database. into a file... when i tried to compile the solution the following error occurs like this error C2664: 'CreateFileW' : cannot convert parameter 1 from 'const char ' to 'LPCWSTR' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
9
36541
by: X Enterprises | last post by:
Hello :) I'm not new to C++, I just don't use it as much as I used to. But anyway, I need to convert LPSTR to LPCWSTR. Here's the function i'm using it in: MYCOMMAND void PrintText( LPSTR pString ) { if(pString)
0
9669
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9517
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10428
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10156
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9997
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5559
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3718
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2916
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.