| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Please Help: Formatted TCHAR to LPTCSTR
Hello
This has got me stumped and I'm sure the answer is easy. Visual C++ Unicode This Works...... TCHAR *buffer; buffer = _T("hello"); //ok LPCTSTR Message = buffer; when Message is used it outputs "hello" This Doesn't...... TCHAR bufa[30]; TCHAR *buffer= bufa; int field1 = 9; swprintf(bufa, L"number is %d",field1); LPCTSTR Message = buffer; This displays nothing. Please help, this is driving me nuts..... Last edited by TestingTimes : March 10th, 2006 at 05:02 AM. Reason: typo |
|
#2
|
|||
|
|||
|
Fixed now...
A good nights sleep, a few typos fixed and ensuring that variables are public makes all the difference.
Quote:
|
|
#3
|
|||
|
|||
|
Quote:
Its because it is LPCTSTR instead of LPCSTR. The latter is char8 while former is TCHAR *. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > Please Help: Formatted TCHAR to LPTCSTR |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|