Click here to Skip to main content
15,906,708 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a DLL file (myForms.DLL) file which contains one form (form1),
with overloads show, with one parameter like this:

Public Overloads Sub Show(ByVal Data As dataTable)
......
end Sub


and, i have an EXE Project without reference for DLL, i want to open the form1 which exist in myForms.DLL in EXE Project. I loaded the myForms.DLL assembley and get the form1 like this:
.....
.....
dim f as form = CType(Activator.CreateInstance(typ), Form)

now, i want to show the form with parameter:

dim mydata as new datatabe
f.show(mydata)

my problem is, the form can not identify the Parameter or Overloads Show() and always Show the original form. How can i open this form with parameter?

thanx
Posted
Updated 22-Sep-11 3:54am
v2

Create the form as your form type, not Form. Since Form knows nothing of your overloaded Show method, it's not going to work.

Dim f as MyForm = CType(Activator.CreateInstance(typ), MyForm)
 
Share this answer
 
hi Dave,

i know that but i can not use form type coz i have no reference for the DLL.

i extracted the form object from DLL file using type and getAssembly.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900