Click here to Skip to main content
15,888,061 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: DCOM configuration Pin
George_George14-Feb-08 3:36
George_George14-Feb-08 3:36 
GeneralLogonUser Failing Pin
Leoinlove14-Feb-08 1:36
Leoinlove14-Feb-08 1:36 
QuestionRe: LogonUser Failing Pin
David Crow14-Feb-08 9:57
David Crow14-Feb-08 9:57 
GeneralRe: LogonUser Failing Pin
Leoinlove14-Feb-08 18:58
Leoinlove14-Feb-08 18:58 
Generalscanf to scanf_s Pin
Russell'13-Feb-08 23:49
Russell'13-Feb-08 23:49 
GeneralRe: scanf to scanf_s Pin
Cedric Moonen14-Feb-08 0:05
Cedric Moonen14-Feb-08 0:05 
GeneralRe: scanf to scanf_s Pin
Russell'14-Feb-08 1:33
Russell'14-Feb-08 1:33 
GeneralRe: scanf to scanf_s Pin
Cedric Moonen14-Feb-08 1:45
Cedric Moonen14-Feb-08 1:45 
Russell' wrote:
I'm sorry but I'm a little bit confused from this differences between VS2003 and 2005


First: this is not really a big difference. It is just that when you create a new project with VC2005, UNICODE is enabled by default and when you create a project with VC2003, UNICODE is not enabled by default.

UNICODE lets you work with strings that are wide characters (so two bytes per character). When UNICODE is defined, the CStringW class will be used and when is it not defined, then CStringA will be used (check the definition of the class CString, you'll see that it is just a 'macro' that redirects to one of the two versions).

When you use the string manipulation functions (like sprintf, scanf, ...), you should use the ones with the 't' at the begining (like _tscanf, ...) because they are also a macro that redirects to the correct function depending of the UNICODE setting.

Now, if you don't want to use UNICODE, you should undefine it and then you can use the char versions of the functions.


Russell' wrote:
I haven't use CStringA and before


You shouldn't use CStringA or CStringW directly. If you do it, then it means that something wrong with the way you handle strings. In your case, why don't you simply use _tscanf_s as I told you ? This way, your code will compile in both cases (if UNICODE is defined or not).


Russell' wrote:
In this case it isn't needed the _T(..) macro when I initialize the string ...


Here also, the _T macro lets you specify a literal string so that it is independant of the UNICODE setting you are using. So, it is good to use it.


Russell' wrote:
I haven't find the way to remove UNICODE from the project,


If you want to remove it, go into your project properties, C/C++ category -> preprocessor and click on the button that appear when you click on "Preprocessor Definitions". There, uncheck the "Inherit from parent or project defaults". You'll see that the preprocessor definition that are inherited are in fact UNICODE and _UNICODE.

By the way, you should search here on CP about articles that discuss UNICODE. It will help you understand what it really does.

Cédric Moonen
Software developer

Charting control [v1.2]

GeneralRe: scanf to scanf_s Pin
Russell'14-Feb-08 2:00
Russell'14-Feb-08 2:00 
QuestionHow to comper 2 CListCtrl table with minimal complexity ? Pin
Yanshof13-Feb-08 23:12
Yanshof13-Feb-08 23:12 
QuestionListView with LargeIcon items of different sizes. Pin
Chesnokov Yuriy13-Feb-08 22:45
professionalChesnokov Yuriy13-Feb-08 22:45 
GeneralRe: ListView with LargeIcon items of different sizes. Pin
zengkun10014-Feb-08 14:35
zengkun10014-Feb-08 14:35 
GeneralProxy/Stub issue Pin
George_George13-Feb-08 21:44
George_George13-Feb-08 21:44 
QuestionMouse Event in Activex Control Pin
manish.patel13-Feb-08 20:56
manish.patel13-Feb-08 20:56 
GeneralRe: Mouse Event in Activex Control Pin
ShilpiP13-Feb-08 22:42
ShilpiP13-Feb-08 22:42 
GeneralRe: Mouse Event in Activex Control Pin
manish.patel13-Feb-08 22:46
manish.patel13-Feb-08 22:46 
GeneralTons of CDialog issue Pin
Llasus13-Feb-08 20:52
Llasus13-Feb-08 20:52 
GeneralRe: Tons of CDialog issue Pin
Rajesh R Subramanian13-Feb-08 21:29
professionalRajesh R Subramanian13-Feb-08 21:29 
GeneralRe: Tons of CDialog issue Pin
Llasus13-Feb-08 23:15
Llasus13-Feb-08 23:15 
GeneralRe: Tons of CDialog issue Pin
Rajesh R Subramanian14-Feb-08 0:02
professionalRajesh R Subramanian14-Feb-08 0:02 
GeneralRe: Tons of CDialog issue Pin
Llasus14-Feb-08 3:43
Llasus14-Feb-08 3:43 
QuestionHow to add Items to a Microsoft 2.0 Combobox control Pin
msr_codeproject13-Feb-08 20:38
msr_codeproject13-Feb-08 20:38 
QuestionCFileDialog Pin
T.RATHA KRISHNAN13-Feb-08 19:04
T.RATHA KRISHNAN13-Feb-08 19:04 
GeneralRe: CFileDialog Pin
Rajesh R Subramanian13-Feb-08 19:40
professionalRajesh R Subramanian13-Feb-08 19:40 
QuestionRe: CFileDialog Pin
T.RATHA KRISHNAN13-Feb-08 19:56
T.RATHA KRISHNAN13-Feb-08 19:56 

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.