473,402 Members | 2,072 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

wstring is causing a win32 console application to exit

Hi,

I have the below code snippet in an already existing Win32 console application.

**********************************

wstring szTemp = _T("Template");

**********************************

This piece of code perfectly compiles but when i run the application, it exits when hitting the above line.This line is in the main() function.
Aug 16 '10 #1
1 1833
weaknessforcats
9,208 Expert Mod 8TB
There is a problem here:

Expand|Select|Wrap|Line Numbers
  1. wstring szTemp = _T("Template");
1) If your project is set for Unicode, then you don't use the TCHAR macros like _T.
2) If your project is set for ASCII, then you don't use wstring. You use string. There is no constructor for wstring that takes an ASCII string as a argument. That is, in ASCII this won't compile

Visual Studio.NET 2008 will not compile this code. So, what compiler are you using?
Aug 16 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Edward | last post by:
Hello, I just finished taking a basic C++ class in High School eariler this year. For the most part we worked with DOS programs in the Win32 console application in Visual C++ 6.0. I've done a...
5
by: Barry Mossman | last post by:
Hi, can I detect whether my class is running within the context of a Console application, vs say a WinForm's application ? also does anyone know whether the compiler or runtime is smart enough...
0
by: Omkar Mate | last post by:
I am developing a Win32 console application (VS.NET, VC++) in which I have to demonstrate the API - "WaitForSingleObject". I have to wait on some key stroke "event". Which event should I use for...
0
by: Maxwell | last post by:
Hello, I recently completed a MC++ (VS2003) DLL that wraps a non MFC C++ DLL and need to use it in a MC++ Console Application (no forms/guis of any kind just output to console). Trouble is...
2
by: Bobrick | last post by:
Hi. I'm trying to create a GUI for a console application I have (written by someone else, but with permission to use it). The console application gathers MIDI data from a port, and returns the...
0
by: smanzel | last post by:
When I attempt to open a new project in Visual studio and I select the Win32 Console Project icon the Win32 Console Application window pops up. However there is nothing in the window. There is...
2
by: SheetalGandhi24 | last post by:
Hi I need to use the System.IO namespace in the Win32 console application. Any clues for doing the same? Basically, I need to load the files of a particular folder in an array. I need to do...
4
by: Peter Nimmo | last post by:
Hi, I am writting a windows application that I want to be able to act as if it where a Console application in certain circumstances, such as error logging. Whilst I have nearly got it, it...
3
by: vpascuzzi | last post by:
Hey folks, Thought I could use some help with this. I have the basic foundation around the app, but cannot seem to get things working correctly. Can someone have a look at the code below and...
5
by: shockna1 | last post by:
Im using Microsoft visual c++ 2008 and 2010 and neither of them will let me create a new win32 console application they will let me edit them but not make a new one. It used to work but evry time I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.