home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.misc
- Path: sparky!uunet!spool.mu.edu!sdd.hp.com!uakari.primate.wisc.edu!ames!pacbell.com!tandem!av8r.cpd.Tandem.com!stu
- From: stu@av8r.cpd.Tandem.com (Stuart Phillips)
- Subject: OWL: Adopting other child windows ?
- Message-ID: <1992Sep14.165854.18660@tandem.com>
- Sender: news@tandem.com
- Nntp-Posting-Host: av8r.cpd.tandem.com
- Reply-To: stu@Tandem.COM
- Organization: Tandem Computers, Cupertino - USA
- Date: Mon, 14 Sep 1992 16:58:54 GMT
- Lines: 40
-
- I've developed a class using Borland OWL that controls a window with two
- child windows on its surface much like that used by the File Manager. I
- would like to make this general enough that I can use it in multiple
- applications and so have made the class itself ignorant of the behavior
- of each of its child windows.
-
- I'd like to create the child windows and pass them as parameters to the
- constructor of my controlling class (TDoubleWindow) - something like this:
-
- PTWindow left = new TWindow(this,"");
- PTWindow right = new TWindow(this,"");
-
- PTDoubleWindow Dbl = new TDoubleWindow(this,"Title",left,right);
-
- The problem with this approach is that the owning window of the children
- isnt Dbl since the left and right child windows are owned by the common
- parent of all three.
-
- There is a method in TWindowObject called SetParent() that looks tailor
- made to do the job of having Dbl adopt left and right as its own children.
- I tried inserting calls as follows in the constructor for TDoubleWindow:
-
- left->SetParent(this);
- right->SetParent(this);
-
- ....but when I subsequently call MakeWindow to actually create the interface
- objects, the MakeWindow fails with error -5 (illegal window handle).
-
- How does an object adopt other objects children ?
-
-
-
- I have one work around that ducks the entire issue and that's defining
- TDoubleWindow as a template class; however this makes it a pain to derive
- objects from TDoubleWindow so I'm still in need of a solution.
-
- Can anyone help ?
-
- Thanks
- Stu
-