Click here to Skip to main content
15,909,091 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How change the menu background color? Pin
Hamid_RT24-Aug-07 3:02
Hamid_RT24-Aug-07 3:02 
QuestionTCHAR to char * Pin
Rajesh_Parameswaran23-Aug-07 9:00
Rajesh_Parameswaran23-Aug-07 9:00 
AnswerRe: TCHAR to char * Pin
Mark Salsbery23-Aug-07 9:44
Mark Salsbery23-Aug-07 9:44 
AnswerRe: TCHAR to char * Pin
Mark Salsbery23-Aug-07 9:49
Mark Salsbery23-Aug-07 9:49 
AnswerRe: TCHAR to char * Pin
Michael Dunn23-Aug-07 10:49
sitebuilderMichael Dunn23-Aug-07 10:49 
GeneralRe: TCHAR to char * Pin
Mark Salsbery23-Aug-07 11:17
Mark Salsbery23-Aug-07 11:17 
GeneralRe: TCHAR to char * Pin
Michael Dunn23-Aug-07 12:15
sitebuilderMichael Dunn23-Aug-07 12:15 
GeneralRe: TCHAR to char * Pin
Mark Salsbery23-Aug-07 12:40
Mark Salsbery23-Aug-07 12:40 
Note this is just for me, in one test application - MFC/Unicode/VS2005. 
I ask because I don't know Smile | :)

T2CA doesn't compile.

CT2CA works like this
   char buff[80];
   strcpy(buff, CT2CA(_T("Hello World")));
but doesn't work like this
   CString s = _T("Hello world!");
   const char* p = CT2CA(LPCTSTR(s));
   // p is invalid here

Here's a sample from  ATL and MFC String Conversion Macros[^]
// Example 3
// Incorrect use of conversion macros.

void ExampleFunctionW( LPCWSTR pszW )

{
 // Create a temporary instance of CW2A,
  
 // save a pointer to it and then delete
 // the temportary instance.
   
 LPCSTR pszA = CW2A( pszW );
 // The pszA in the following line is an invalid pointer,
 // as the instance of CW2A has gone out of scope.
 ExampleFunctionA( pszA );

}
In the section "A Warning Regarding Temporary Class Instances" there's more details.

I just don't know how to use the old ones, which it states are still supported. 
I'm missing some detail somewhere Smile | :)

Mark



Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: TCHAR to char * Pin
Mark Salsbery23-Aug-07 12:45
Mark Salsbery23-Aug-07 12:45 
GeneralRe: TCHAR to char * Pin
Rajesh_Parameswaran24-Aug-07 0:47
Rajesh_Parameswaran24-Aug-07 0:47 
GeneralRe: TCHAR to char * [modified] Pin
Mark Salsbery24-Aug-07 5:04
Mark Salsbery24-Aug-07 5:04 
AnswerRe: TCHAR to char * Pin
Obukhov1-Nov-10 21:24
Obukhov1-Nov-10 21:24 
Questionproblem with context menu code Pin
ivansla23-Aug-07 8:26
ivansla23-Aug-07 8:26 
AnswerRe: problem with context menu code Pin
Maximilien23-Aug-07 8:31
Maximilien23-Aug-07 8:31 
AnswerRe: problem with context menu code Pin
Mark Salsbery23-Aug-07 9:53
Mark Salsbery23-Aug-07 9:53 
AnswerRe: "file selected is not in required template" VC 6.0 MFC Pin
jhwurmbach23-Aug-07 6:25
jhwurmbach23-Aug-07 6:25 
GeneralRe: "file selected is not in required template" VC 6.0 MFC Pin
Vaclav_23-Aug-07 6:37
Vaclav_23-Aug-07 6:37 
GeneralRe: "file selected is not in required template" VC 6.0 MFC Pin
ThatsAlok23-Aug-07 19:26
ThatsAlok23-Aug-07 19:26 
GeneralRe: "file selected is not in required template" VC 6.0 MFC Pin
Vaclav_24-Aug-07 9:47
Vaclav_24-Aug-07 9:47 
GeneralRe: "file selected is not in required template" VC 6.0 MFC Pin
Iain Clarke, Warrior Programmer23-Aug-07 22:28
Iain Clarke, Warrior Programmer23-Aug-07 22:28 
GeneralRe: "file selected is not in required template" VC 6.0 MFC Pin
Vaclav_24-Aug-07 9:36
Vaclav_24-Aug-07 9:36 
GeneralRe: "file selected is not in required template" VC 6.0 MFC Pin
Iain Clarke, Warrior Programmer24-Aug-07 12:27
Iain Clarke, Warrior Programmer24-Aug-07 12:27 
QuestionFacing problem while running exe created using 2005 Pin
Ravi Jadhav23-Aug-07 5:12
Ravi Jadhav23-Aug-07 5:12 
AnswerRe: Facing problem while running exe created using 2005 Pin
James R. Twine23-Aug-07 5:22
James R. Twine23-Aug-07 5:22 
AnswerRe: Facing problem while running exe created using 2005 Pin
David Crow23-Aug-07 6:15
David Crow23-Aug-07 6:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.