Click here to Skip to main content
15,889,281 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Enumerate network printers in metro apps Pin
Wes Aday26-Apr-12 3:02
professionalWes Aday26-Apr-12 3:02 
AnswerRe: Enumerate network printers in metro apps Pin
Maximilien26-Apr-12 5:29
Maximilien26-Apr-12 5:29 
QuestionGet File Extension Pin
jkirkerx25-Apr-12 16:13
professionaljkirkerx25-Apr-12 16:13 
AnswerRe: Get File Extension Pin
_Flaviu25-Apr-12 19:58
_Flaviu25-Apr-12 19:58 
GeneralRe: Get File Extension Pin
jkirkerx26-Apr-12 7:05
professionaljkirkerx26-Apr-12 7:05 
AnswerRe: Get File Extension Pin
enhzflep25-Apr-12 21:13
enhzflep25-Apr-12 21:13 
GeneralRe: Get File Extension Pin
Aescleal26-Apr-12 0:02
Aescleal26-Apr-12 0:02 
GeneralRe: Get File Extension Pin
enhzflep26-Apr-12 0:16
enhzflep26-Apr-12 0:16 
Thanks mate!

Not so sure, I guess it would have been better to explicitly cast the '.' to a wchar_t. I figured since the function takes a wchar_t that this would be implicitly cast for me.

Compiling with gcc 4.something, the only warning I get was for line 7 (the wszFilename declaration) -
"warning: deprecated conversion from string constant to 'wchar_t*' "

It compiles & runs just fine with the -Wall and -Wextra compiler flags.

If the line in question is changed to:
C++
wchar_t *wszFilename = (wchar_t*)"project.config.user";


Then it compiles with 0 warnings. [EDIT: but crashes like a bus!]

The line should read:
C++
wchar_t *wszFilename = (wchar_t*)L"project.config.user";



Nice catch!

Thumbs Up | :thumbsup:
Simon.

modified 26-Apr-12 6:26am.

GeneralRe: Get File Extension Pin
Aescleal26-Apr-12 4:35
Aescleal26-Apr-12 4:35 
SuggestionRe: Get File Extension Pin
Randor 26-Apr-12 1:01
professional Randor 26-Apr-12 1:01 
GeneralRe: Get File Extension Pin
enhzflep26-Apr-12 3:47
enhzflep26-Apr-12 3:47 
GeneralRe: Get File Extension Pin
Joe Woodbury29-Apr-12 7:06
professionalJoe Woodbury29-Apr-12 7:06 
AnswerRe: Get File Extension Pin
Randor 26-Apr-12 0:57
professional Randor 26-Apr-12 0:57 
GeneralRe: Get File Extension Pin
jkirkerx26-Apr-12 7:10
professionaljkirkerx26-Apr-12 7:10 
GeneralRe: Get File Extension Pin
«_Superman_»26-Apr-12 19:49
professional«_Superman_»26-Apr-12 19:49 
GeneralRe: Get File Extension Pin
jkirkerx26-Apr-12 10:08
professionaljkirkerx26-Apr-12 10:08 
GeneralRe: Get File Extension Pin
Randor 26-Apr-12 18:23
professional Randor 26-Apr-12 18:23 
GeneralRe: Get File Extension Pin
Le Quang Long27-Apr-12 15:10
Le Quang Long27-Apr-12 15:10 
GeneralRe: Get File Extension Pin
Randor 28-Apr-12 0:14
professional Randor 28-Apr-12 0:14 
AnswerRe: Get File Extension Pin
JohnCz29-Apr-12 4:28
JohnCz29-Apr-12 4:28 
GeneralRe: Get File Extension Pin
jkirkerx29-Apr-12 9:27
professionaljkirkerx29-Apr-12 9:27 
GeneralCALLING A NEW DIALOG Pin
Le Quang Long25-Apr-12 4:01
Le Quang Long25-Apr-12 4:01 
AnswerRe: CALLING A NEW DIALOG Pin
Albert Holguin25-Apr-12 4:15
professionalAlbert Holguin25-Apr-12 4:15 
GeneralRe: CALLING A NEW DIALOG Pin
JohnCz29-Apr-12 4:54
JohnCz29-Apr-12 4:54 
GeneralRe: CALLING A NEW DIALOG Pin
Maximilien25-Apr-12 5:28
Maximilien25-Apr-12 5:28 

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.