Click here to Skip to main content
15,890,897 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Problem Reading/Writing Registry in Windows 7? Pin
Shaheed Legion26-Feb-13 5:21
Shaheed Legion26-Feb-13 5:21 
QuestionUsing C++ TagLib, not TagLib Sharp - how to write APIC frames Pin
Steve S19-Feb-13 6:32
Steve S19-Feb-13 6:32 
AnswerRe: Using C++ TagLib, not TagLib Sharp - how to write APIC frames Pin
Steve S19-Feb-13 7:21
Steve S19-Feb-13 7:21 
Question[MFC] How to use the Picture Control to show jpg image? Pin
yu-jian19-Feb-13 4:26
yu-jian19-Feb-13 4:26 
AnswerRe: [MFC] How to use the Picture Control to show jpg image? Pin
jeron119-Feb-13 4:35
jeron119-Feb-13 4:35 
GeneralRe: [MFC] How to use the Picture Control to show jpg image? Pin
yu-jian20-Feb-13 16:32
yu-jian20-Feb-13 16:32 
AnswerRe: [MFC] How to use the Picture Control to show jpg image? Pin
Michael Haephrati20-Feb-13 10:20
professionalMichael Haephrati20-Feb-13 10:20 
Questionglut project Pin
abhi sharma19-Feb-13 2:02
abhi sharma19-Feb-13 2:02 
AnswerRe: glut project Pin
Richard MacCutchan19-Feb-13 3:06
mveRichard MacCutchan19-Feb-13 3:06 
Questionexe fine in codeblocks Pin
abhi sharma19-Feb-13 1:54
abhi sharma19-Feb-13 1:54 
AnswerRe: exe fine in codeblocks Pin
Albert Holguin19-Feb-13 4:10
professionalAlbert Holguin19-Feb-13 4:10 
QuestionRe: exe fine in codeblocks Pin
David Crow19-Feb-13 4:40
David Crow19-Feb-13 4:40 
QuestionWDK 7600.16385.1 Compiler Pin
msr_codeproject18-Feb-13 17:44
msr_codeproject18-Feb-13 17:44 
AnswerRe: WDK 7600.16385.1 Compiler Pin
Richard MacCutchan19-Feb-13 3:05
mveRichard MacCutchan19-Feb-13 3:05 
QuestionInvoking a modal Dialog whitin a modal Pin
ForNow18-Feb-13 12:39
ForNow18-Feb-13 12:39 
AnswerRe: Invoking a modal Dialog whitin a modal Pin
Jibesh18-Feb-13 12:55
professionalJibesh18-Feb-13 12:55 
of-course yes. You can invoke a modal dialog from another modal dialog. Coming to your problem there is something wrong with the usage of CFileDialog. can you paste the complete exception stack/message so that we can able find what went wrong.

I took this sample from here[^] hope you are doing the same. if not give a try.

vc
CFileDialog dlgFile(...);
...
CString fileName;
dlgFile.GetOFN().lpstrFile = fileName.GetBuffer(<very large number&>);
dlgFile.GetOFN().nMaxFile = <very large number >;

INT_PTR nResult = dlgFile.DoModal();
fileName.ReleaseBuffer();


Read these lines carefully

The destruction of CFileDialog objects is handled automatically. It is not necessary to call CDialog::EndDialog.
To allow the user to select multiple files, set the OFN_ALLOWMULTISELECT flag before calling DoModal. You need to supply your own filename buffer to accommodate the returned list of multiple filenames. Do this by replacing m_ofn.lpstrFile with a pointer to a buffer you have allocated, after constructing the CFileDialog, but before calling DoModal.

When the user allocates their own buffer to accommodate OFN_ALLOWMULTISELECT, the buffer can't be larger than 2048 or else everything gets corrupted (2048 is the maximum size).

Additionally, you must set m_ofn.nMaxFile with the number of characters in the buffer pointed to by m_ofn.lpstrFile. If you set the maximum number of files to be selected to n, the necessary buffer size is n*(_MAX_PATH + 1) + 1.

GeneralRe: Invoking a modal Dialog whitin a modal Pin
ForNow18-Feb-13 13:42
ForNow18-Feb-13 13:42 
GeneralRe: Invoking a modal Dialog whitin a modal Pin
«_Superman_»18-Feb-13 19:51
professional«_Superman_»18-Feb-13 19:51 
GeneralRe: Invoking a modal Dialog whitin a modal Pin
Richard MacCutchan18-Feb-13 21:24
mveRichard MacCutchan18-Feb-13 21:24 
GeneralRe: Invoking a modal Dialog whitin a modal Pin
ForNow19-Feb-13 2:29
ForNow19-Feb-13 2:29 
GeneralRe: Invoking a modal Dialog whitin a modal Pin
Richard MacCutchan19-Feb-13 3:02
mveRichard MacCutchan19-Feb-13 3:02 
GeneralRe: Invoking a modal Dialog whitin a modal Pin
David Crow19-Feb-13 9:42
David Crow19-Feb-13 9:42 
GeneralRe: Invoking a modal Dialog whitin a modal Pin
ForNow19-Feb-13 11:33
ForNow19-Feb-13 11:33 
SuggestionRe: Invoking a modal Dialog whitin a modal Pin
David Crow20-Feb-13 3:25
David Crow20-Feb-13 3:25 
GeneralRe: Invoking a modal Dialog whitin a modal Pin
ForNow20-Feb-13 7:22
ForNow20-Feb-13 7:22 

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.