Click here to Skip to main content
15,920,688 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how do i deallocate memory using delete ? Pin
CPallini21-Dec-06 20:49
mveCPallini21-Dec-06 20:49 
AnswerRe: how do i deallocate memory using delete ? Pin
John R. Shaw21-Dec-06 21:21
John R. Shaw21-Dec-06 21:21 
GeneralRe: how do i deallocate memory using delete ? Pin
Rage21-Dec-06 22:36
professionalRage21-Dec-06 22:36 
AnswerRe: how do i deallocate memory using delete ? Pin
prasad_som21-Dec-06 21:32
prasad_som21-Dec-06 21:32 
AnswerRe: how do i deallocate memory using delete ? Pin
Cristian Amarie25-Dec-06 6:05
Cristian Amarie25-Dec-06 6:05 
QuestionMicrosoft Unicode Layer? Pin
Atul2321-Dec-06 20:39
Atul2321-Dec-06 20:39 
AnswerRe: Microsoft Unicode Layer? Pin
Rajesh R Subramanian21-Dec-06 21:22
professionalRajesh R Subramanian21-Dec-06 21:22 
AnswerRe: Microsoft Unicode Layer? Pin
John R. Shaw21-Dec-06 21:58
John R. Shaw21-Dec-06 21:58 
The following applies to VC++ 6.0:

First you need to add the preprocessor definition _UNICODE to your project settings. Then make all your character types TCHAR; when compiled for Unicode TCHAR becomes a wide character (wchar_t); otherwise it is a char. If you are using the MFC CString then just use as you normally would. If you are using C functions like strlen, then you need to use the Microsoft equivalent functions that begin with _ts. These functions take TCHAR arguments and will change based on whether you specified _UNICODE or not. That means when you compile for Unicode they expect wchar_t types and in non-Unicode they expect char types.

If you are planning to use C++ strings (std::string) then the simplest solution is to use basic_string<TCHAR> as the string type.

Do not for get to use the _T macro wherever you type in a string, this adds an ‘L’ before the string when compiled for Unicode: _T(“This is a string”).

For more information check the MSDN and you might want to grab a copy of ‘Agent Ransack’ off the Net, you can use it to search for all the places that _UNICODE is used in the files that come with VC to see how it is being used.


INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
QuestionUnicode Problems Pin
kiranin21-Dec-06 20:22
kiranin21-Dec-06 20:22 
AnswerRe: Unicode Problems Pin
Sakthiu21-Dec-06 20:34
Sakthiu21-Dec-06 20:34 
GeneralRe: Unicode Problems Pin
kiranin21-Dec-06 20:39
kiranin21-Dec-06 20:39 
GeneralRe: Unicode Problems Pin
prasad_som21-Dec-06 20:41
prasad_som21-Dec-06 20:41 
GeneralRe: Unicode Problems Pin
kiranin21-Dec-06 20:44
kiranin21-Dec-06 20:44 
AnswerRe: Unicode Problems Pin
Johann Gerell21-Dec-06 21:22
Johann Gerell21-Dec-06 21:22 
GeneralRe: Unicode Problems [modified] Pin
CPallini21-Dec-06 22:50
mveCPallini21-Dec-06 22:50 
QuestionRe: Unicode Problems Pin
kiranin22-Dec-06 0:17
kiranin22-Dec-06 0:17 
AnswerRe: Unicode Problems Pin
CPallini22-Dec-06 2:59
mveCPallini22-Dec-06 2:59 
AnswerRe: Unicode Problems Pin
Cristian Amarie25-Dec-06 6:10
Cristian Amarie25-Dec-06 6:10 
QuestionTree Control Pin
Krishnatv21-Dec-06 20:07
Krishnatv21-Dec-06 20:07 
AnswerRe: Tree Control Pin
Rage21-Dec-06 22:28
professionalRage21-Dec-06 22:28 
GeneralRe: Tree Control Pin
Krishnatv21-Dec-06 22:59
Krishnatv21-Dec-06 22:59 
Questionimage capture Pin
indrajeshr21-Dec-06 20:06
indrajeshr21-Dec-06 20:06 
AnswerRe: image capture Pin
Rage21-Dec-06 22:32
professionalRage21-Dec-06 22:32 
AnswerRe: image capture Pin
Greg Daye22-Dec-06 2:59
Greg Daye22-Dec-06 2:59 
GeneralRe: image capture Pin
Mark Salsbery22-Dec-06 5:17
Mark Salsbery22-Dec-06 5:17 

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.