Dynamic object creation How to? 
Author Message
 Dynamic object creation How to?

Hi everyone,

I need to create some objects dynamically and I do not
know at compile time what objects this will be at the most
the user will provide the class name of the object how can
I get a creator for an object when I know the object's class
name but I do not have any of them in a form or something
will the createobject function help and how should I use it
any info on the subject will be apreciated.

Regards
Johnnie.

--
I want to go back to my youth
which so recklessly through
away, just to get a chance to
through them away again.



Thu, 15 Apr 2004 21:53:32 GMT  
 Dynamic object creation How to?
hi
basically u can pass a string to createobject
e.g
    on error resume next
    Dim str as String
    str = Inputbox("Enter name of object to create")
    Set obj = CreatObject(str)
    'now check if there was an error
    if err.number<>0 then
        msgbox "could not create an object of this type"
        err.clear
    else
        msgbox "Object of type " & TypeName(obj) & " created"
    end if

This is just a sample to illustrate my point
hope this helps

Saurabh


Quote:
> Hi everyone,

> I need to create some objects dynamically and I do not
> know at compile time what objects this will be at the most
> the user will provide the class name of the object how can
> I get a creator for an object when I know the object's class
> name but I do not have any of them in a form or something
> will the createobject function help and how should I use it
> any info on the subject will be apreciated.

> Regards
> Johnnie.

> --
> I want to go back to my youth
> which so recklessly through
> away, just to get a chance to
> through them away again.



Fri, 16 Apr 2004 00:17:35 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. dynamic object creation in VB4

2. Dynamic Object creation

3. Dynamic object creation at run-time...

4. Dynamic object creation at run-time...

5. Dynamic object creation license

6. Dynamic Creation of Object Names - Forms

7. Dynamic creation of ole object

8. dynamic creation of a textbox object

9. Dynamic Control Creation, Controls object has no .Add ???

10. dynamic creation of an object type

11. Dynamic Creation of Visual Objects

12. Dynamic creation of variable names

 

 
Powered by phpBB® Forum Software