views:

109

answers:

3

Is it possible to create an instance of a class in VB 5 CCE from a string containing the class's definition?

Um... I'm actually using VB 5 CCE because I'm too cheap to get a version that costs money. Can someone tell me how to implement it that way?

TYVM to whoever answers this!!!!!

NVM... I'm downloading VS 2008 Express...

A: 

Yes, look at System.Reflection.Assembly.CreateInstance()

Matt Grande
-1, he's using vb5
Chris McCall
Frig, so I get -1 because he didn't include that information the first time? Frig...
Matt Grande
Next time, instead of complaining in the comments, edit your answer so I can change my vote.
Chris McCall
A: 
Dim obj As Object
Set obj = CreateObject("ClassName")
Chris McCall
A: 

If you mean something like given a string with the following value: "Public Class Foo:Public Sub Bar():End Sub:End Class" and you want something like Dim the class = Eval(theString) and do something with your new class, see this.

They do it by extending it in VBScript.

Jimmy Chandra