🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.c
Article #309023

Re: Jak sprawdzić jakiej klasy jest obiekt (wskaźnik) ?

#309023
From: Borneq
Date: Mon, 06 Feb 2017 12:45
10 lines
1283 bytes
W dniu 06.02.2017 o 11:53, Borneq pisze:
> Więc chciałbym sprawdzić obiekt list, czy jest wxListView czy
> wxCheckedListCtrl i specjalnie wywołać InsertItem.

http://stackoverflow.com/questions/15898121/how-to-determine-actual-object-type-at-runtime-in-c

jest
if (dynamic_cast<Derived*>(b)) { ... }

więcej, to można użyć <typeinfo> i pobrać typeid(*b).name()
Technical Details
Message-ID: <o79r53$tv$1@node1.news.atman.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail
References: <o79kim$psa$1@node1.news.atman.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail
From: Borneq <borneq@antyspam.hidden.pl>
Newsgroups: pl.comp.lang.c
Subject: Re: Jak sprawdzić jakiej klasy jest obiekt
 (wskaźnik) ?
Date: Mon, 6 Feb 2017 13:45:23 +0100
Organization: ATMAN - ATM S.A.
Lines: 10
Message-ID: <o79r53$tv$1@node1.news.atman.pl>
References: <o79kim$psa$1@node1.news.atman.pl>
NNTP-Posting-Host: 91.239.205.105
Mime-Version: 1.0
X-Trace: node1.news.atman.pl 1486385123 959 91.239.205.105 (6 Feb 2017 12:45:23 GMT)
X-Complaints-To: usenet@atman.pl
NNTP-Posting-Date: Mon, 6 Feb 2017 12:45:23 +0000 (UTC)
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0
In-Reply-To: <o79kim$psa$1@node1.news.atman.pl>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit