Click here to Skip to main content
15,886,963 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Looking for data structures for long integer Pin
Maxwell Chen4-Jun-06 21:03
Maxwell Chen4-Jun-06 21:03 
GeneralRe: Looking for data structures for long integer Pin
George_George4-Jun-06 21:15
George_George4-Jun-06 21:15 
AnswerRe: Looking for data structures for long integer Pin
Maxwell Chen4-Jun-06 21:46
Maxwell Chen4-Jun-06 21:46 
GeneralRe: Looking for data structures for long integer Pin
George_George4-Jun-06 22:15
George_George4-Jun-06 22:15 
Questionopen file dialog Pin
iLL eFFect4-Jun-06 20:25
iLL eFFect4-Jun-06 20:25 
AnswerRe: open file dialog Pin
Hamid_RT4-Jun-06 20:37
Hamid_RT4-Jun-06 20:37 
GeneralRe: open file dialog Pin
iLL eFFect4-Jun-06 22:44
iLL eFFect4-Jun-06 22:44 
AnswerRe: open file dialog Pin
Viorel.4-Jun-06 20:53
Viorel.4-Jun-06 20:53 
In my opinion, possible causes are:

1. Invalid value assigned to hwndOwner member in "ofn.hwndOwner = hwnd", since hwnd was not initialized before. You must assign a valid window handle, or NULL.

2. Cast expressions like "(LPWSTR)szFile" is incorrect, since szFile is not an Unicode string. You probably did this because your application is compiled in Unicode mode. The recomended way is:

TCHAR szFile[260]; // or, better is: "TCHAR szFile[_MAX_PATH];"
...
ofn.lpstrFile = szFile;

Now it should compile in both ANSI and Unicode mode. (You may need to include TCHAR.h to your file).

3. The assignment ofn.lpstrFilter = (LPCWSTR)"All\0*.*\0Text\0*.TXT\0"; is incorect and must look like this:

ofn.lpstrFilter = _T("All\0*.*\0Text\0*.TXT\0");

which should work in both ANSI and Unicode mode.

4. According to documentation, GetSaveFileName returns non-zero in case of success, which theoretically can be different from TRUE constant. I think it is better to compare with FALSE (zero):

if(GetSaveFileName (&ofn) != FALSE) ...

or simply

if(GetSaveFileName (&ofn)) ...


Hope this will help.
QuestionShow struct contents in Notepad Pin
RajiRaghu4-Jun-06 19:33
RajiRaghu4-Jun-06 19:33 
AnswerRe: Show struct contents in Notepad Pin
_AnsHUMAN_ 4-Jun-06 19:43
_AnsHUMAN_ 4-Jun-06 19:43 
GeneralRe: Show struct contents in Notepad Pin
RajiRaghu4-Jun-06 19:51
RajiRaghu4-Jun-06 19:51 
GeneralRe: Show struct contents in Notepad Pin
ThatsAlok4-Jun-06 19:56
ThatsAlok4-Jun-06 19:56 
GeneralRe: Show struct contents in Notepad Pin
RajiRaghu4-Jun-06 20:00
RajiRaghu4-Jun-06 20:00 
GeneralRe: Show struct contents in Notepad Pin
ThatsAlok4-Jun-06 20:38
ThatsAlok4-Jun-06 20:38 
GeneralRe: Show struct contents in Notepad Pin
FarPointer4-Jun-06 20:59
FarPointer4-Jun-06 20:59 
GeneralRe: Show struct contents in Notepad Pin
RajiRaghu4-Jun-06 21:47
RajiRaghu4-Jun-06 21:47 
GeneralRe: Show struct contents in Notepad Pin
ThatsAlok4-Jun-06 22:11
ThatsAlok4-Jun-06 22:11 
GeneralRe: Show struct contents in Notepad Pin
Hamid_RT4-Jun-06 22:17
Hamid_RT4-Jun-06 22:17 
GeneralRe: Show struct contents in Notepad Pin
RajiRaghu4-Jun-06 22:56
RajiRaghu4-Jun-06 22:56 
AnswerRe: Show struct contents in Notepad Pin
_AnsHUMAN_ 4-Jun-06 20:38
_AnsHUMAN_ 4-Jun-06 20:38 
QuestionEvent Viewer Pin
ashokvishnu4-Jun-06 19:26
ashokvishnu4-Jun-06 19:26 
AnswerRe: Event Viewer Pin
Anilkumar K V5-Jun-06 0:40
Anilkumar K V5-Jun-06 0:40 
GeneralRe: Event Viewer Pin
ashokvishnu5-Jun-06 1:09
ashokvishnu5-Jun-06 1:09 
AnswerRe: Event Viewer Pin
Blake Miller6-Jun-06 5:16
Blake Miller6-Jun-06 5:16 
QuestionSignificance of MFC/.NET Pin
Nattack4-Jun-06 18:18
Nattack4-Jun-06 18:18 

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.