|
-
Apr 11th, 2004, 08:05 AM
#1
Thread Starter
New Member
How to create object without using "NEW"?
I want to create a instance of class, but it's only a "private" class in this project, so i can't use "CreateObject".
and i can't know which class i want to create from. it's like this:
private function createNewInstance(obj as object) as object
end function
i want this function return a new object like obj, but VB6 does not support reflection like .Net, so how can i do?
-
Apr 11th, 2004, 10:08 AM
#2
I assume the objects are things such as Command Buttons and Text Boxes?
VB Code:
Private Function CreateNewInstance(frm As Form, obj As Object)
If TypeOf obj Is CommandButton Then
Set obj = frm.Controls.Add("VB.COMMANDBUTTON", "NewCommandButton")
obj.Visible = True
End If
End Function
Is this what you are after?
Phreak
Last edited by «°°phReAk°°»; Apr 11th, 2004 at 10:12 AM.
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Apr 12th, 2004, 12:06 AM
#3
Thread Starter
New Member
It's not control
Tt is just a class.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|