Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / RTTI and wxwindows

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. RTTI and wxwindows
#3915
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(http://www.wxwidgets.org/manuals/2.4.2/wx455.htm#runtimeclassoverview) 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
#3967
Posted by: upCASE 2004-04-30 15:17:50
Hi!
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.
upCASE
-----------------------------------
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
#3970
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 • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
¥1,290.00 ·
 
 
¥918.00 ·
 
 
¥890.00 ·
 
 
¥294.00 ·
 
 
¥430.00 ·
 
 
¥1,380.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0