Guidance Forums / wxWidgets (wxWindows) in C++ / RTTI and wxwindows

Search 搜索
Home Home

Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. RTTI and wxwindows
Posted by: bobmorton 2004-04-24 20:12:52
Hi, I've been developping a GUI with wxwidgets for an application which uses RTTI(the typeid function). However i've just discovered wxwidgets forbids the usage of typeid(because of the -fno-rtti compilation option). I've tried to use the RTTI included with wxwidgets and described in this page( without any success.
I tried adding an heritance link with wxObject to the classes in which I wanted to put the RTTI macros but this didn't help(at the begining these classes had nothing to do with wxwindows). If anyone has already used RTTI in such a case could he tell me how he did, thanks very much!
Message2. Re: RTTI and wxwindows
Posted by: upCASE 2004-04-30 15:17:50
Well, I did this only once, but it worked fine once I figured I had to use DECLARE_DYNAMIC_CLASS and IMPLEMENT_DYNAMIC_CLASS.

"wxwidgets forbids the usage of typeid" Really??
I guess you can't use rtti stuff since compiling with -fno-rtti won't give you support for it, but it isn't forbidden by wxWidgets. I'm sure you can use RTTI and wxWidgets together. All it says is that wxWidgets doesn't use RTTI, because some older compilers didn't support it.

BTW: Check out version 2.5.1. It has support for "native" RTTI, streams and exceptions if the compiler supports it.
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message3. Re: RTTI and wxwindows
Posted by: bobmorton 2004-04-30 15:45:41
ok I thought it was because it couldn't support both RTTI systems, I'll try this, thanks for the help!
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
© Thu 2024-6-20  Guidance Laboratory Inc. Hits:0