.dll creation in solution

I have a solution with 2 projects in it; I'm using VS 2008 C#.  Is it possible to have one of the projects in the solution created as a .dll while the other (main project) is an .exe file with the previously mentioned .dll included?

If so, please give me the steps, or point to some docs.

Thanks...
rmmarshAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Snarf0001Commented:
If the projects are already created (specifically the one you want as a dll) it may be tricky.
If you were starting from scratch:

Create new project (Windows Forms Application)

Right click on the solution in the solution explorer, and Add -> New Project (of type "Class Library") which will create the dll app

Right click the PROJECT you created in step one, and go to Add Reference
Click the "Projects" tab, and the dll proj you created in step 2 should appear.

Select that one, and the dll will automatically be added.  All builds / debug / release versions will be in sync with each other as you build the solution.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rmmarshAuthor Commented:
OK... got that far on my own... now the question is:  is it possible for the .dll to reference objects in the .exe file?  If so, how?  (I've tried all kinds of stuff, like passing the mainForm to the .dll, but it doesn't find the objects.)
0
Snarf0001Commented:
So you want to reference functions / objects in the dll from the exe, AND reference functions / objects from the exe in the dll?

With 2 projects you can't do that, as it would create a circular dependancy, but one way around would be to create a 3rd dll project, which contained Interfaces to the objects or functions you want to call.

In both other projects, you can inherit the 3rd dll, and have the shared objects implement those interfaces.
0
Introduction to R

R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.

Snarf0001Commented:
Just re-reading that response, I realize I did a really horrible job explaining that.
Let me know if it wasn't clear.
0
rmmarshAuthor Commented:
What I'm trying to do is break up this hugh (700 M) program into parts (one .exe and several .dlls) where the dlls are infrequently used.  Unfortunately, I need to have the .dll <--> .exe references, because that's the way it was originally written.  Was there a better way to write it?  (the .dll needs to reference some objects in the .exe like the database connection, but I can re-write that).  I guess the major question is:  can and how can the .dll reference objects in the main form?  or if they are re-written, what do I have to look out for (ie. do they have to "stand-alone"?

HTH
0
rmmarshAuthor Commented:
Thank you... sorry for the delay in awarding points.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.