home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / os / mswindo / programm / misc / 3473 < prev    next >
Encoding:
Text File  |  1992-11-17  |  2.6 KB  |  76 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!wupost!gumby!yale!yale.edu!jvnc.net!darwin.sura.net!zaphod.mps.ohio-state.edu!sample.eng.ohio-state.edu!purdue!yuma!longs.LANCE.ColoState.Edu!bb760597
  3. From: bb760597@longs.LANCE.ColoState.Edu ()
  4. Subject: OWL:  MDI doesn't like TDialog-type child windows?!?
  5. Message-ID: <Nov17.020204.8207@yuma.ACNS.ColoState.EDU>
  6. Sender: news@yuma.ACNS.ColoState.EDU (News Account)
  7. Date: Tue, 17 Nov 1992 02:02:04 GMT
  8. Distribution: na
  9. Reply-To: bb760597@longs.LANCE.ColoState.Edu ()
  10. Nntp-Posting-Host: engineer.lance.colostate.edu
  11. Organization: Colorado State University, Fort Collins, CO  80523
  12. Keywords: OWL, objectwindows, MDI, dialog, TDialog 
  13. Lines: 61
  14.  
  15. I am trying to write an OWL MDI application that uses a modeless dialog
  16. as a child window.  Unless I am doing something wrong (which is probably
  17. the case), it doesn't appear that MDI supports dialogs as children.
  18.  
  19. I'm using the standard method of making dialog boxes...
  20.  
  21. class TMyDialog : public TDialog
  22. {
  23. public:
  24.         PTComboBox aComboBox;
  25.         PTEdit anEdit;
  26.  
  27.         TMyDialog(PTWindowsObject aParent, LPSTR aResourceID);
  28.         ~TMyDialog();
  29. };
  30.  
  31. TMyDialog::TMyDialog(PTWindowsObject aParent, LPSTR aResourceID) :
  32.         TDialog(aParent, aResourceID)
  33. {
  34.         aComboBox = new TComboBox(this, ID_COMBO, 0);
  35.         anEdit = new TEdit(this, ID_EDIT, 0);
  36. }
  37.  
  38. TMyDialog::~TMyDialog()
  39. {
  40.         delete aComboBox;
  41.         delete anEdit;
  42. }
  43.  
  44. void TMyMainWindow::MakeTheDialogChild()
  45. // TMyMainWindow is an inherited class of TMDIFrame
  46. {
  47.         PTWindowsObject PTWndObj;
  48.  
  49. // "MYDIALOG" is the Resource ID of the Dialog Box.
  50.  
  51.         if ((PTWndObj = GetModule()->MakeWindow(
  52.                         new TMyDialog(this, "MYDIALOG"))) != NULL)
  53.                 ShowWindow(PTWndObj->HWindow, SW_SHOW);
  54.         else
  55.                 BWCCMessageBox(HWindow, "Can't create MyDialog",
  56.                                 "DEBUG", MB_OK);
  57. }
  58.  
  59.  
  60.  
  61. This segment of code works fine in a non-MDI application, but in my MDI
  62. program, the dialog is displayed, but does not respond to messages, mouse
  63. clicks, or any other user interaction.  The Edit control in the dialog box
  64. does seem to accept text (via the TEdit::SetText function), but the
  65. ComboBox doesn't work at all.
  66.  
  67. Comments, suggestions, and code fragments confirming or contradicting this
  68. would be greatly appreciated.
  69.  
  70.  
  71. --
  72. -------------------------------------------------------------------------------
  73.  Blake Buhlig                                        Colorado State University
  74.  bb760597@longs.LANCE.ColoState.Edu            Electrical/Computer Engineering
  75. -------------------------------------------------------------------------------
  76.