15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Modal CFrameWnd???

Roger M. -- RUNDEWOOD@cerner.com
Friday, November 08, 1996

Environment: Win 95, VC++ 4.0

I have the need to display a CFrameWnd (with a CDocument and CFormView)
modally from a regular DLL when an OLE automation method is called.  I
have tried creating a CDialog, calling DoModal on it, making it
invisible by calling MoveWindow(0,0,0,0) in its OnInitDialog, and then
immediately calling LoadFrame to create my CFrameWnd-derived object. 
The dialog is hidden fine, the frame window is created fine, but the
frame window even though parented to the dialog is not modal to the
calling application.

The question:  Am I on the right track?  Should I be trying to do this
some other way?  Any suggestions would be greatly appreciated.




Doug Brubacher -- Doug_Brubacher@compuware.com
Monday, November 11, 1996

     MFC displays Modal dialogs by simply disabling the parent.
     
     You can use this same trick by disabling your calling application when 
     displaying your CFrameWnd.  In that case you probably would not need 
     this modal dialog stuff.
     
     Regards,
     
     Doug Brubacher
     DouglasB@msn.com




Alex Sevugan -- asevugan@csci.csc.com
Tuesday, November 12, 1996

[Mini-digest: 2 responses]

you can also use the BeginModalState and EndModalState member functions
of CFrameWnd to achieve the same result.

-alaks

Doug Brubacher wrote:
> 
>      MFC displays Modal dialogs by simply disabling the parent.
> 
>      You can use this same trick by disabling your calling application when
>      displaying your CFrameWnd.  In that case you probably would not need
>      this modal dialog stuff.
> 
>      Regards,
> 
>      Doug Brubacher
>      DouglasB@msn.com


-- 

-----------------------------------------------
 Alaks Sevugan           CSC CIS        
 Technical Consultant    115 North Neil Street
 (217) 351-8250 (2161)   Champaign, Illinois 
 asevugan@csci.csc.com   61820 	   	  
-----------------------------------------------
-----From: "Doug Brubacher" 

     MFC displays Modal dialogs by simply disabling the parent.
     
     You can use this same trick by disabling your calling application when 
     displaying your CFrameWnd.  In that case you probably would not need 
     this modal dialog stuff.
     
     Regards,
     
     Doug Brubacher
     DouglasB@msn.com





| Вернуться в корень Архива |