Click here to Skip to main content
15,887,746 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalfile date time stamps Pin
ByNar27-Feb-04 2:36
ByNar27-Feb-04 2:36 
GeneralRe: file date time stamps Pin
David Crow27-Feb-04 5:17
David Crow27-Feb-04 5:17 
GeneralGetAdaptersInfo with windows NT Pin
Aviv Halperin27-Feb-04 2:25
Aviv Halperin27-Feb-04 2:25 
GeneralGrabbing text from Window document Pin
Kashif Ali24527-Feb-04 1:47
sussKashif Ali24527-Feb-04 1:47 
GeneralRe: Grabbing text from Window document Pin
David Crow27-Feb-04 5:22
David Crow27-Feb-04 5:22 
GeneralModeless Dialog in DLL Pin
paul hoshovsky27-Feb-04 1:23
paul hoshovsky27-Feb-04 1:23 
GeneralRe: Modeless Dialog in DLL Pin
Prakash Nadar27-Feb-04 4:34
Prakash Nadar27-Feb-04 4:34 
GeneralRe: Modeless Dialog in DLL Pin
paul hoshovsky2-Mar-04 1:50
paul hoshovsky2-Mar-04 1:50 
Thank you for your suggestion.

It got me thinking about the dialog style. In the main exe where I have a number of modeless dialogs, I set the dialog style to include control. This has the effect in the main exe of allowing the tab key to move between the controls on any modeless dialog. When the last control is exited (loses focus), the dialog style causes the tab key to move out of the current modeless dialog and enter the next modeless dialog.

But in the case of the DLL, this was not correct. The solution turned out to be to clear the dialog style settings and leave only the Visible checked.

Once I solved this small hitch (like two days later), I then discovered that while the tab key works properly inside the modeless Dialog created by the DLL, the effect of leaving the DLL was disabled. This was because the control style was not set.

In the end, I settled for raising an event (i.e. callback) on one of the controls in the DLL that changed the focus to a control in the main app.

in the following example, MyModeless was the hWnd returned from the DLL for the dialog


BOOL CMainEXEApp::PreTranslateMessage(MSG* pMsg)
{
if (TheView->MyModeless!=NULL)
{
if (IsDialogMessage(TheView->MyModeless, pMsg))
return TRUE;
}
return CWinApp::PreTranslateMessage(pMsg);
}
void CMainEXEApp::ChangeTabOrder( void * pPointer)
{
if (pPointer ==NULL)
{
SetFocus(TheView->GetDlgItem(IDC_BUTTON2)->m_hWnd);
}
}

Thanks for the response

paul
GeneralDetecting Keyboard Input in Console Application Pin
Tomaz Rotovnik27-Feb-04 1:11
Tomaz Rotovnik27-Feb-04 1:11 
GeneralRe: Detecting Keyboard Input in Console Application Pin
Selvam R27-Feb-04 1:19
professionalSelvam R27-Feb-04 1:19 
GeneralRe: Detecting Keyboard Input in Console Application Pin
catngo27-Feb-04 19:24
catngo27-Feb-04 19:24 
GeneralSorting an array with pointers Pin
hollowsoft27-Feb-04 0:52
hollowsoft27-Feb-04 0:52 
GeneralRe: Sorting an array with pointers Pin
Selvam R27-Feb-04 1:16
professionalSelvam R27-Feb-04 1:16 
GeneralRe: Sorting an array with pointers Pin
Kevin McFarlane27-Feb-04 1:17
Kevin McFarlane27-Feb-04 1:17 
GeneralRe: Sorting an array with pointers Pin
Kevin McFarlane27-Feb-04 4:46
Kevin McFarlane27-Feb-04 4:46 
GeneralRe: Sorting an array with pointers Pin
David Crow27-Feb-04 5:28
David Crow27-Feb-04 5:28 
GeneralGlyph Repositioning Pin
Member 88417927-Feb-04 0:24
Member 88417927-Feb-04 0:24 
QuestionVideo memory, why so slow? Pin
includeh1027-Feb-04 0:01
includeh1027-Feb-04 0:01 
QuestionMessageBox and font changing? Pin
Jump_Around26-Feb-04 23:57
Jump_Around26-Feb-04 23:57 
AnswerRe: MessageBox and font changing? Pin
Prakash Nadar27-Feb-04 0:11
Prakash Nadar27-Feb-04 0:11 
GeneralProblem with critical section. Pin
Prakash Nadar26-Feb-04 23:47
Prakash Nadar26-Feb-04 23:47 
GeneralRe: Problem with critical section. Pin
_Magnus_27-Feb-04 0:11
_Magnus_27-Feb-04 0:11 
GeneralRe: Problem with critical section. Pin
Prakash Nadar27-Feb-04 0:14
Prakash Nadar27-Feb-04 0:14 
GeneralEdit control and Unicode Pin
Jahangir Jamshed26-Feb-04 23:47
sussJahangir Jamshed26-Feb-04 23:47 
GeneralRe: Edit control and Unicode Pin
Prakash Nadar27-Feb-04 0:08
Prakash Nadar27-Feb-04 0:08 

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.