tchar Questions

5

I'm trying to convert a TCHAR to a string as in: std::string mypath; TCHAR path[MAX_PATH]; GetModuleFileName( NULL, path, MAX_PATH ); I need to set mypath to that of path. I did a simple loop an...
Inflexed asked 15/5, 2011 at 3:34

6

Solved

How do I convert a TCHAR array to std::string (not to std::basic_string)?
Dougherty asked 9/6, 2011 at 10:34

4

Solved

When you build an app on Windows using TCHAR support, %s in _tprintf() means char * string for Ansi builds and wchar_t * for Unicode builds while %S means the reverse. But are there any format spe...
Kilohertz asked 14/4, 2011 at 20:20

3

I'm trying to combine 2 tchar. char username[UNLEN+1]; DWORD username_len = UNLEN+1; GetUserName(username, &username_len); TCHAR* appdatapath ="C:\\Users\\"+username+"\\AppData"; But I get e...
Parapodium asked 5/2, 2014 at 13:18

3

Solved

I'm trying to get a simple OpenCV sample working in C++ on Windows and my C++ is more than rusty. The sample is fairly simple: #include <opencv2/core/core.hpp> #include <opencv2/highgui/...
Propositus asked 10/10, 2013 at 16:41

4

How to convert to TCHAR[] to char[] ?
Mai asked 24/11, 2009 at 10:40

2

I am trying to write cross platform i18n C++ code. Since most linux system prefer to use UTF-8 as the character encoding, I thought that I should use string on linux and wstring on Windows. Is tcha...
Exine asked 21/5, 2009 at 23:37

8

Solved

This seems like a pretty softball question, but I always have a hard time looking up this function because there seem there are so many variations regarding the referencing of char and tchar.
Postgraduate asked 1/10, 2008 at 20:0

4

Solved

I get a compilation error on the line: MessageBox(e.getAllExceptionStr().c_str(), _T("Error initializing the sound player")); Error 4 error C2664: 'CWnd::MessageBoxA' : cannot convert parameter ...
Smirch asked 9/3, 2015 at 16:13

3

Solved

I've been asked to add functionality to an existing old project but i cannot get it to build. It handles unicode strings but i get a lot of errors regarding the use of TCHAR.Specifically almost eve...
Trina asked 21/1, 2014 at 12:14

2

how I can convert string to tchar in VC++? string internetprotocol="127.4.5.6"; TCHAR szProxyAddr[16]; i want to set: szProxyAddr=internetprotocol; how i can do it?
Overlord asked 8/12, 2013 at 14:57

3

Solved

char* stheParameterFileName = argv[1]; //I'm passing the file name as a parameter. TCHAR szName [512]; How can I convert char* to TCHAR []?
Visualize asked 2/5, 2013 at 16:19

2

Solved

I am trying to check my applications path, and if it is not a specified path, then move it. I feel like my code is solid, yet it does not work properly. TCHAR pCheck[MAX_PATH]; TCHAR xPath[MAX_PAT...
Larch asked 10/11, 2012 at 16:46

5

Solved

I am revising some very old (10 years) C code. The code compiles on Unix/Mac with GCC and cross-compiles for Windows with MinGW. Currently there are TCHAR strings throughout. I'd like to get rid of...
Easeful asked 11/6, 2011 at 11:16

2

Solved

What are the various differences between the two symbols TCHAR and _TCHAR type defined in the Windows header tchar.h? Explain with examples. Briefly describe scenarios where you would use TCHAR as ...
Randee asked 1/6, 2010 at 10:25

4

Solved

I am sure the following has a rational explanation but I am nevertheless a bit baffled. The issue is with a function which creates a _TCHAR[CONSTANT], a _TCHAR*, concatenates them and returns the ...
Durfee asked 29/7, 2011 at 10:35

3

Solved

i asked a question here involving C++ and C# communicating. The problem got solved but led to a new problem. this returns a String (C#) return Marshal.PtrToStringAnsi(decryptsn(InpData)); this ...
Teocalli asked 14/4, 2011 at 17:14

2

Solved

I am new to C++ coding, coming from Java and C# background. I'm puzzled by the proliferation of #define terms starting with the most basic: #define _tmain wmain When I first learned a smattering...
Montanez asked 8/2, 2011 at 18:47

2

Solved

I have a TCHAR define below: TCHAR szProcessName[MAX_PATH] = TEXT("<unknown>"); and I want to comapare as below: if(szProcessName == "NDSClient.exe") { } But then I am getting the err...
Enticement asked 17/11, 2010 at 6:0

2

Solved

I'm running the latest cygwin on windows 7 (32-bit), and trying to build an open-source project, RtAudio (it doesn't currently build on this platform). One of the problems I've worked around is a...
Historicity asked 12/11, 2010 at 20:23

4

Solved

I have a TCHAR and value as below: TCHAR szDestPathRoot[MAX_PATH]="String This"; Now I want the 1st three character from TCHAR , like below: szDestPathRoot.substring(0,2); How can I do this. ...
Dross asked 28/10, 2010 at 4:47

3

On platforms different than Windows you could easily use char * strings and treat them as UTF-8. The problem is that on Windows you are required to accept and send messages using wchar* strings (W...
Earthworm asked 27/4, 2010 at 16:19

2

Solved

Is it advisable to use strcmp or _tcscmp for comparing strings in Unicode versions?
Jess asked 21/1, 2010 at 5:22

4

Solved

We need to pass a format _TCHAR * string, and a number of char * strings into a function with variable-length args: inline void FooBar(const _TCHAR *szFmt, const char *cArgs, ...) { //... } So ...
Roband asked 23/10, 2009 at 12:49

2

Solved

I have a TCHAR array in my C++ code which I want to assign static strings to it. I set an initial string to it via TCHAR myVariable[260] = TEXT("initial value"); Everything works fine on this. ...
Sclerotomy asked 10/10, 2009 at 12:13

© 2022 - 2024 — McMap. All rights reserved.