Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GetClassInfo problem solved

5 views
Skip to first unread message

Riccardo Cohen

unread,
Mar 5, 2008, 2:48:05 AM3/5/08
to
For those who use win->GetClassInfo(); on wxWindow subclasses, be very
carefull on MS windows

I had a wxPanel subclass whose win->GetClassInfo(); returned wxPanel's
one instead of my subclass one. There was no compilation problem, and it
worked perfecly with GCC, but microsoft didn't seem to call the good
virtual function. I couldn't reproduce on a little sample, it did that
only in my big projet...

I finally found (by chance) that adding this :

#undef GetClassInfo

after all includes, 1) in the header, and 2) in the cpp, did change
something : wx macros DECLARE_CLASS & IMPLEMENT_CLASS are building a new
function in your class : GetClassInfo(), but because of Microsoft macro
#define GetClassInfo GetClassInfoA !!! it changes its name ...

undef it and it works.

(maybe a little word in the doc of rtti overview would be nice ?)

Thank you for your attention :)


--
Très cordialement,

Riccardo Cohen
-------------------------------------------
Articque
http://www.articque.com
149 av Général de Gaulle
37230 Fondettes - France
tel : 02-47-49-90-49
fax : 02-47-49-91-49


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-u...@lists.wxwidgets.org
For additional commands, e-mail: wx-use...@lists.wxwidgets.org

Igor Korot

unread,
Mar 5, 2008, 12:36:34 PM3/5/08
to
Hi, ALL,
IIRC (I am at work now), at least 2.8 says in comments:

"Not all compilers support dynamic_cast, so here is a little
hack to get this implemented"

I would be very interested what compilers it's talking about.

Thank you.

0 new messages