
dynamically creating instances of classes
Hi back Brad,
I think I tried using CreatObject function. It works only when
creating instances of a DLL and not instances of any classes present in
the same project. Or am I missing here anything?
Could you please qualify this?
Thanks,
-abhi
Quote:
> Abhi,
> >How do I create the class's
> >object when only the name is available.
> Check out VB's intrinsic CreateObject function, and simply
> use the generic Object data type.
> --
> Brad Martinez, http://www.mvps.org
> Please direct questions/replies to the newsgroup
> > Hi folks,
> > In my VB application I have a number of classes. The names of which
> >are to be retrieved from the database. I wish to create instances of
> >these classes dynamically when the name of the class is
> >provided/available from the recordset. How do I create the class's
> >object when only the name is available.
> >To clarify the matter a little more, let me give you an example which
> >hopefully will shed some more light on my problem:
> >Dim sClassName as String
> >sClassName = m_rs.Fields("class_name").Value
> >How to instantiate an object of type sClassName
> >dim AnObject as object
> >set AnObject = new <<<sClassName>>>
> >I'd greatly appreciate your suggestions to resolve this issue.
> >Thanks in advance,
> >-abhijeet
> >--
> >Abhijeet Kulkarni
> >(319)366-0973 *4233, CCH Incorporated
> >Sent via Deja.com http://www.deja.com/
> >Before you buy.
--
Abhijeet Kulkarni
CCH Incorporated
Sent via Deja.com http://www.deja.com/
Before you buy.