DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Sat, 23 Jun 2007 16:05:18 -0700,    posted on: microsoft.public.dotnet.internationalization        back       

Thread Index
  1    Bob Altman am


Multi-byte characters?   
If I create a new Win32 Console project (unmanaged C++, Visual Studio 2005), 
and add the following to the main program:

  // Add this above the main routine
  #include <windows.h>  // Add this at the top of the file

  // Add this to the main routine
  MessageBox(NULL, "A", "B", MB_OK);

The compiler (Visual Studio 2005) complains that it can't convert parameter 
2 from 'const char [2]' to 'LPCWSTR'.

I don't understand why the compiler apparently thinks that I am using 
multi-byte character semantics.  The really bizarre part is that I have 
another project that contains calls to MessageBox, and that project compiles 
just fine.  I've looked at the project properties in both projects, but I 
can't see anything that would obviously cause one to compile correctly and 
one to fail to compile.

This all began when I tried to write some code that formats a message and 
sends it to the MessageBox function, like this:

  ostringstream msg;
  msg << "my message expression";
  MessageBox(NULL, msg.str().c_str(), "Title", MB_OK);

In this case, the compiler complains that it can't convert parameter 2 from 
'const char *' to 'LPCWSTR'.  But, as I said, I have this identical code in 
another project and it works just fine.

TIA - Bob
Date:Sat, 23 Jun 2007 16:05:18 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us