Passing reference to a Winform into DLL

  • Thread starter Thread starter Charlie@CBFC
  • Start date Start date
C

Charlie@CBFC

Hi:

My project has a seperate DLL for biz logic and an EXE for client app. I
would like to pass in a reference to a form in client app to DLL to capture
form element data for updating. In my DLL I have a reference to WinForms so
I can accept a form as a parameter. However, I must cast the form argument
to the appropriate form so I can access it members, but I can't reference an
EXE in DLL. How do I do this?

Thanks,
Charlie
 
Charlie@CBFC said:
My project has a seperate DLL for biz logic and an EXE for client app. I
would like to pass in a reference to a form in client app to DLL to
capture
form element data for updating. In my DLL I have a reference to WinForms
so
I can accept a form as a parameter. However, I must cast the form
argument
to the appropriate form so I can access it members, but I can't reference
an
EXE in DLL. How do I do this?

Hi. Create an interface, have the form implement the interface, then pass
the interface instance to the DLL. You can define the interface in the DLL
so that both have access to its definition.

-- Alan
 
Back
Top