passing values

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to know how to refer back to an object that I have passed to a dll
For instance, if I pass a form to a function in the dll then how do I determine the name of the form passed inside of the dll

reportform.gettype.

I want to be able to refer back to the form I passed in and reference the different properties of the for

Thanks
 
* "=?Utf-8?B?bWlrZQ==?= said:
I would like to know how to refer back to an object that I have passed to a dll.
For instance, if I pass a form to a function in the dll then how do I determine the name of the form passed inside of the dll.

reportform.gettype.?

I want to be able to refer back to the form I passed in and reference the different properties of the form

You may want to define a 2nd dll which defines an interface the form
implements, and then reference this dll from your EXE project and your
other dll project. The forms in the EXE project can implement the
inteface(s), and you use the interface as parameter type in your 2nd
class library:

\\\
Public Sub Foo(ByVal x As MyInterfaces.IDataEntryForm)
...
End Sub
///
 
' Create an interface :

Public Interface IMyForm

Property firstProperty()

Property secondProperty()

Sub mySub

...

End Interface


' Let your form implements it :

Public class TheForm
Inherits System.windows.form
Implements IMyForm

...
Property firstProperty() Implements IMyForm.firstProperty
...
End Property
...

End class


' In your DLL define your method like this with a reference to your
Interface :

Class MyClassInDLL

Public Sub mySubInDLL (byref form1 As IMyForm)
...
End Sub

....

End Class

I hope I have answered your question.

mike said:
I would like to know how to refer back to an object that I have passed to a dll.
For instance, if I pass a form to a function in the dll then how do I
determine the name of the form passed inside of the dll.
reportform.gettype.?

I want to be able to refer back to the form I passed in and reference the
different properties of the form
 
Mike, is this a .NET dll? If so, the object type I'm assuming will be Form
right? If so, you'll be able to reference it directly

Can you show me an example of a function in the dll you'd pass the form to
(mainly the signature) and the calling line of code?
mike said:
I would like to know how to refer back to an object that I have passed to a dll.
For instance, if I pass a form to a function in the dll then how do I
determine the name of the form passed inside of the dll.
reportform.gettype.?

I want to be able to refer back to the form I passed in and reference the
different properties of the form
 
Back
Top