473,382 Members | 1,302 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Passing reference to a Winform into DLL

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
Nov 17 '05 #1
1 1849
"Charlie@CBFC" <ch*****@comcast.net> wrote in message
news:er*************@TK2MSFTNGP12.phx.gbl...
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
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

58
by: jr | last post by:
Sorry for this very dumb question, but I've clearly got a long way to go! Can someone please help me pass an array into a function. Here's a starting point. void TheMainFunc() { // Body of...
8
by: Dennis Myrén | last post by:
I have these tiny classes, implementing an interface through which their method Render ( CosWriter writer ) ; is called. Given a specific context, there are potentially a lot of such objects,...
6
by: Newbie | last post by:
How do I pass string values from one webform to another?
3
by: JJ | last post by:
Hi, I need to pass a dataset to another win form along with a SqldataAdapter. I don't want to recreate the SqlDataAdapter again either. So to pass to another Win form in my windows form app, do...
2
by: Bob | last post by:
Hi, Can anyone tell me how to resolve this: I am calling a web service from a WinForm app and passing a typed dataset as a parameter. I have added the dataset to the web service project but I...
0
by: Costa Lino | last post by:
Hi all, I have a webservice with 2 method public int AddUpdateTask(eurosmallbiz.FrameWork.Systems.Calendar.Task task,string username,string password,int companyid,string SyncRule)
6
by: MSDNAndi | last post by:
Hi, I get the following warning: "Possibly incorrect assignment to local 'oLockObject' which is the argument to a using or lock statement. The Dispose call or unlocking will happen on the...
12
by: Andrew Bullock | last post by:
Hi, I have two classes, A and B, B takes an A as an argument in its constructor: A a1 = new A(); B b = new B(a1);
7
by: AMP | last post by:
Hello, I have this in form1: namespace Pass { public partial class Form1 : Form { public Form2 form2; public Form1() {
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.