Click here to Skip to main content
15,914,165 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Excel automation question Pin
Manfred Staiger21-Jul-03 3:05
Manfred Staiger21-Jul-03 3:05 
GeneralRe: Excel automation question Pin
Hadi Rezaee23-Jul-03 10:10
Hadi Rezaee23-Jul-03 10:10 
GeneralSpeech Recognition Pin
superstein21-Jul-03 2:30
superstein21-Jul-03 2:30 
GeneralRe: Speech Recognition Pin
Bob Stanneveld21-Jul-03 8:52
Bob Stanneveld21-Jul-03 8:52 
GeneralRe: Speech Recognition Pin
superstein22-Jul-03 4:41
superstein22-Jul-03 4:41 
Generalclose IE window!!! Pin
xxhimanshu21-Jul-03 1:47
xxhimanshu21-Jul-03 1:47 
GeneralRe: close IE window!!! Pin
Bob Stanneveld21-Jul-03 9:03
Bob Stanneveld21-Jul-03 9:03 
GeneralDuplicate Dialogs Pin
Jay Hova21-Jul-03 1:32
Jay Hova21-Jul-03 1:32 
Hi,
I posted this last week, and tried to work on this over the weekend but with no success. This is something that i can't seem to figure out. Can someone tell me how to do this exactly? I never really coded before and this is causing me much headaches.

This was the suggestion that I received from G.Steudtel:
Try to get the applications pointer of its CMainCommand instance, and use this pointer.
Or send/post the command to the application as if the user has selected the dialog via the menu.

Here is what I posted:
I have a modeless window and a modal window, each having their own window option that when selected bring up the corresonding window. The modal window has radio buttons on it, so when a specific reaio button is selected and ok is entered, it will display the modless window.

When I select the menu to bring up the modeless window it works fine, only opens one window or sets focus to it if it has not been created. When I select the modal window and check the appropriate radio it will display the modeless window regardless if it is created already. It will just continue to duplicate the modeless window.

Can someone help me out so that it will set focus on the open window and not diplicate it.
currently I am using this code in the OnOK method.
if (!m_pCommandOpt)
{     
    m_pCommandOpt = new CMainCommand(this);     
    if (m_pCommandOpt->Create(IDD_MAIN_TAB_DIALOG) == TRUE)     
    {           
         GetDlgItem(IDOK)->EnableWindow(FALSE);
         m_pCommandOpt->ShowWindow(SW_SHOW);
    }
}      
else	m_pCommandOpt->SetActiveWindow();


THANKS in advance.
GeneralRe: Duplicate Dialogs Pin
Ryan Binns21-Jul-03 1:48
Ryan Binns21-Jul-03 1:48 
GeneralRe: Duplicate Dialogs Pin
Jay Hova21-Jul-03 2:47
Jay Hova21-Jul-03 2:47 
GeneralRe: Duplicate Dialogs Pin
Ryan Binns21-Jul-03 2:55
Ryan Binns21-Jul-03 2:55 
GeneralRe: Duplicate Dialogs Pin
Jay Hova21-Jul-03 3:18
Jay Hova21-Jul-03 3:18 
GeneralRe: Duplicate Dialogs Pin
Ryan Binns21-Jul-03 3:26
Ryan Binns21-Jul-03 3:26 
GeneralRe: Duplicate Dialogs Pin
Jay Hova21-Jul-03 3:39
Jay Hova21-Jul-03 3:39 
GeneralRe: Duplicate Dialogs Pin
Ryan Binns21-Jul-03 3:40
Ryan Binns21-Jul-03 3:40 
GeneralRe: Duplicate Dialogs Pin
G. Steudtel21-Jul-03 3:34
G. Steudtel21-Jul-03 3:34 
GeneralRe: Duplicate Dialogs Pin
Jay Hova22-Jul-03 9:42
Jay Hova22-Jul-03 9:42 
QuestionHow to disable CD ROM autoplay function? Pin
HansonDavid21-Jul-03 1:15
HansonDavid21-Jul-03 1:15 
AnswerRe: How to disable CD ROM autoplay function? Pin
Ryan Binns21-Jul-03 1:55
Ryan Binns21-Jul-03 1:55 
GeneralRe: How to disable CD ROM autoplay function? Pin
HansonDavid21-Jul-03 18:18
HansonDavid21-Jul-03 18:18 
GeneralRe: How to disable CD ROM autoplay function? Pin
Ryan Binns21-Jul-03 18:57
Ryan Binns21-Jul-03 18:57 
GeneralRe: How to disable CD ROM autoplay function? Pin
HansonDavid22-Jul-03 1:09
HansonDavid22-Jul-03 1:09 
GeneralRe: How to disable CD ROM autoplay function? Pin
Ryan Binns22-Jul-03 1:14
Ryan Binns22-Jul-03 1:14 
GeneralSet Screensaver!!!!!!!!!!!!!!!!!!!!!! Pin
xxhimanshu21-Jul-03 1:11
xxhimanshu21-Jul-03 1:11 
GeneralRe: Set Screensaver!!!!!!!!!!!!!!!!!!!!!! Pin
Ryan Binns21-Jul-03 1:50
Ryan Binns21-Jul-03 1:50 

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.