Re: type casts (FindWindow)
Bryan Bulten <[email protected]>
| Newsgroups | gmane.comp.lib.wxwindows.wxnet |
|---|---|
| Message-ID | <[email protected]> |
> So what can I do?
With the new code (committed to CVS), use Object::FindObject; this will
return the appropriate object:
ListBox lb = (ListBox)FindWindow(ID_MY_WIN);
or even:
MyListBox mlb = (MyListBox)FindWindow(ID_MY_WIN);
> What do we actually need the typemap for? Cannot
> we query the RTTI system at run-time?
The typemap (now removed) was using the RTTI to instantiate the
appropriate object. The problem with it was that in the second case
above, it would instantiate the incorrect object, and cause a run-time
exception.
The system in place now, holds a reference to the created object, and
looks up that reference using the C++ IntPtr.
This method will also allow for client data objects as well.
--
Bryan Bulten
http://opendev.ods.org/
http://wxnet.sourceforge.net/
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+qpbt32WFWIzmzHgRAg+nAJ0ezEaWdHwohP+u67WflDwJk15RpwCfXcEA sul3stlw4sFIleDHB5sfy3M= =+mWG -----END PGP SIGNATURE-----