I am doing the following to utalize a DLL in my application that may/may not exist. Anyway, all I need to figure out is how to pass an object as an argument to the class constructor when the instance is created.
If I were doing it with a dll I had a reference to in the project I could just do the following:
Dim oMyNewObject as New vtxObject.Company(oSettings)
However, when I do it like this using reflection I can't figure out how to pass the argument object, it makes me supply more info than I know/understand.
Dim ofrmCustom As Object
Dim myDLL As [Assembly]
myDLL = [Assembly].LoadFrom("My.dll")
ofrmCustom = myDLL.CreateInstance("vtxEDCFSC.Form1") 'I NEED TO SUPPLY ARGS HERE
ofrmCustom.MdiParent = Me
Catch ex As Exception
Debug.WriteLine("Threw Error: " & ex.Message)
Having problem with activation attributes. Please tell me what to put where the ?? are below, I can't figure it out. As far as I know my new class doesn't need any of the ?? parameters.
ofrmCustom = myDLL.CreateInstance(oModules.ClassName, True, BindingFlags.CreateInstance, ??, oSettings, ??, ??)
Please don't provide me with the CreateInstance method documentation, I've seen it. I just need an example of what to put where the ??'s are above. Please provide the entire line including all arguments in the method call exactly as you think they will work.
Thanks, I appreciate your time. Scott Carullo