Cannot display the dialog derived from common file dialog 
Author Message
 Cannot display the dialog derived from common file dialog

Hi,

I derived a class from CFileDialog with a template dialog,I would like to
open picture files with preview. It can work well in EXE project,but the
file dialog cann't be seen in extended DLL.
What't the reason?

Thanks in advance!

Robbery



Tue, 22 Nov 2005 01:19:21 GMT  
 Cannot display the dialog derived from common file dialog

Quote:

>Hi,

>I derived a class from CFileDialog with a template dialog,I would like to
>open picture files with preview. It can work well in EXE project,but the
>file dialog cann't be seen in extended DLL.
>What't the reason?

Probably your best bet is to trace through it with the de{*filter*}. If you're
talking about an extension DLL, the dialog's resource ID must be unique.
That is, the EXE and any other extension DLLs cannot use that same ID for
their own dialogs.

--
Doug Harrison
Microsoft MVP - Visual C++



Tue, 22 Nov 2005 01:34:38 GMT  
 Cannot display the dialog derived from common file dialog
Hi,Doug

Thank you,
I am sure the dialog resource's  ID is unique.I try to trace it with
de{*filter*},I think it should popup the dialog which I hoped when it run here:
if (m_bOpenFileDialog)
  nResult = ::GetOpenFileName(&m_ofn);  // it can run here
 else
  nResult = ::GetSaveFileName(&m_ofn);

but no dialog here

It really bothers me.



Tue, 22 Nov 2005 08:50:23 GMT  
 Cannot display the dialog derived from common file dialog

Quote:

>Hi,Doug

>Thank you,
>I am sure the dialog resource's  ID is unique.I try to trace it with
>de{*filter*},I think it should popup the dialog which I hoped when it run here:
>if (m_bOpenFileDialog)
>  nResult = ::GetOpenFileName(&m_ofn);  // it can run here
> else
>  nResult = ::GetSaveFileName(&m_ofn);

>but no dialog here

>It really bothers me.

So GetOpenFileName succeeds but GetSaveFileName fails, with exactly the same
input? What is the value of nResult? If it's zero, call CommDlgExtendedError
and see what it returns. If that doesn't help, you're going to have to take
a close look at the m_ofn contents and try simplifying. Once you get it to a
working state, you'll know that the things you changed were involved in
breaking it in the first place. I don't know if this will help you, but see
this message for a description of a fairly common problem with VC6's MFC,
and attempts to use the Win2K-style file dialogs:

http://www.*-*-*.com/

--
Doug Harrison
Microsoft MVP - Visual C++



Tue, 22 Nov 2005 19:28:57 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Common Open Dialog not displaying a dialog when file doesn't exist

2. Nesting Common File Dialog within my Dialog

3. How to display a Help button in a Open or Save As common dialog box

4. Common Dialogs not displaying on NT4.0

5. File Common Dialog Box with many file types

6. Trouble Getting multiple files using Common File Dialog

7. Generic Thunking and Windows NT: Cannot display dialog boxes in the DLL

8. Cannot display custom FileOpen dialog

9. Help! Dialog box cannot be displayed

10. use derived File Dialog class to open file

11. using derived Dialog class with Dialog Bar

12. How do I derive a child dialog from parent dialog

 

 
Powered by phpBB® Forum Software