🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #2607

Re: dynamic_cast does not work in packages

#2607
From: Dmitry
Date: Sat, 03 Feb 2007 20:39
28 lines
1795 bytes
Remy,
>In order for dynamic_cast to
> work, it has to be called in the same module that declares and
> allocates the object type being tested.

maybe someone will give me idea how can i overcome this problem.

i have TDataSetActions and TMyDataSet  implemented in one package.(package1)

the other modules use this package for design purpose.
meaning, i develop forms with my TDataSetActions and TMyDataSet

the TDataSetActions use TMyDataSet descendant inside package1,
when user fires event for dataset, i need to cast a DataSet to TMyDataSet

TMyDataSet *a_MyDataSet = dynamic_cast<TMyDataSet *>(DataSource->DataSet)

and it this gives a NULL.
thus DataSet->ClassName() ==  "TMyDataSet"


some ideas will be appreciated.
please help.



Dmitry
Technical Details
Message-ID: <45c4f2a7@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!newscon04.news.prodigy.net!prodigy.net!news.linkpendium.com!news.linkpendium.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <45c1f643@newsgroups.borland.com> <45c2330e$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,eea25a98edb328b5
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Dmitry" <dmitry@pikalevo.com>
From: "Dmitry" <dmitry@pikalevo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <45c1f643@newsgroups.borland.com> <45c2330e$1@newsgroups.borland.com>
Subject: Re: dynamic_cast does not work in packages
Date: Sat, 3 Feb 2007 23:39:45 +0300
Lines: 30
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 212.58.203.114
Message-ID: <45c4f2a7@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1170535079 212.58.203.114 (3 Feb 2007 12:37:59 -0800)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!newscon04.news.prodigy.net!prodigy.net!news.linkpendium.com!news.linkpendium.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail