Advertisement

07.12.2004 at 12:52PM PDT, ID: 21056082
[x]
Attachment Details

Strings in VC++.NET (TCHAR)

Asked by auk_ie in Microsoft Visual C++.Net, Microsoft Programming

Tags:

Hello a couple of questions on VC++.NET strings

I have a managed class and I want to create a private string member, TCHAR szMyString;

coming from VC++, my preferred ctring type is TCHAR. How can I use this in VC++.NET

public __gc class USBEnum
      {
      private:
            static bool bDebug = true;
            TCHAR szMyString;           //Gives me an error
}

The above code doen't work, Can anyone tell me why and how to fix it.

Also how can I use the _T macro and how in VC++.NET. So that I can convert my program to unicode easily if required later.

Also what is the best way to output strings to the debug window. I used to use TRACE() with MFC but its not in VC++.NET and I don't think Debug::WriteLine is as good as it does not allow for format specifiers in the string. And I think that the Debug::WriteLine aren't skipped by the compiler in a release build like with TRACE() statements. Any suggestions on how this is done in VC++.NET
  Start Free Trial
 
Loading Advertisement...
 
[+][-]07.12.2004 at 01:40PM PDT, ID: 11533312

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual C++.Net, Microsoft Programming
Tags: tchar
Sign Up Now!
Solution Provided By: drichards
Participating Experts: 3
Solution Grade: A
 
 
[+][-]07.12.2004 at 01:58PM PDT, ID: 11533488

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.12.2004 at 02:05PM PDT, ID: 11533565

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.12.2004 at 02:40PM PDT, ID: 11533878

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.12.2004 at 02:40PM PDT, ID: 11533881

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.12.2004 at 03:01PM PDT, ID: 11534073

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.12.2004 at 03:03PM PDT, ID: 11534087

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.12.2004 at 06:46PM PDT, ID: 11535284

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.12.2004 at 07:08PM PDT, ID: 11535425

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.12.2004 at 07:56PM PDT, ID: 11535643

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.12.2004 at 08:18PM PDT, ID: 11535731

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.12.2004 at 08:46PM PDT, ID: 11535843

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.12.2004 at 10:19PM PDT, ID: 11536236

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32