Click here to Skip to main content
15,917,618 members
Home / Discussions / C#
   

C#

 
GeneralRe: Program Flow Pin
Jon Newman23-Jun-03 4:42
Jon Newman23-Jun-03 4:42 
Generalcreating a single EXE from multiple projects Pin
mikechambers22-Jun-03 6:20
mikechambers22-Jun-03 6:20 
GeneralRe: creating a single EXE from multiple projects Pin
leppie22-Jun-03 11:16
leppie22-Jun-03 11:16 
GeneralRe: creating a single EXE from multiple projects Pin
mikechambers22-Jun-03 11:39
mikechambers22-Jun-03 11:39 
GeneralRe: creating a single EXE from multiple projects Pin
leppie22-Jun-03 11:59
leppie22-Jun-03 11:59 
GeneralRe: creating a single EXE from multiple projects Pin
Rocky Moore22-Jun-03 23:56
Rocky Moore22-Jun-03 23:56 
GeneralRe: creating a single EXE from multiple projects Pin
mikechambers23-Jun-03 6:25
mikechambers23-Jun-03 6:25 
GeneralRe: creating a single EXE from multiple projects Pin
Rocky Moore23-Jun-03 8:50
Rocky Moore23-Jun-03 8:50 
Well, actually, you have your program broke up in project right now. You would select the output to be a DLL for each of the projects which contains "supporting code". The project that has your main entry would be set as EXE output.

Assuming you have all your projects in one solution file, you would right click on the References item in your project that contains the EXE and select Add Reference. This will bring up a that should have three tabs and the last one being "Projects". The tab will list all the projects that are in the currently solution and you simply select the projects that you main application will need (probably all of them) and hit [Select] and then OK. That will bind those DLLS to your main application. Each project will produce on DLL and you will have your single main application (EXE). When you launch your EXE it will automatically load the DLLS as needed. Not one line of code to do it.

You might try just creating a new solution with a single WinForm Windows application. Then Insert another project into the solutions but this time use the "Class Library" project. That will build your skeleton project already set as a DLL. Then in the class it generates simple put a single method in there ( that does:

public static IAmHere(string message)
{
System.Diagnostics.Debug.WriteLine(message);
}

Right click on you main WinForm project on references and selec the Add References and add the project reference to the Class Library project you created.

After that, add in your main form, like in the constructor, a call to your library class you created and the IAMHere function your added to it like:

TheClassICreated.IAmHere("Yep");

This will call the method that is in the class library dll you created. To your application it does not care if it is in a DLL or the main application, it calls the same in either case. The only thing you need to do to let your application use the code as if it is in the main application is to add the reference to the project.

In the old C++ days, I did not bother with DLLS unless I had to. In C# they are so easy to use, I end up with a dozen or more of them in a sizable application. I build librarys of utility classes, wrappers to controls, abstraction classes for abstracting data, simply popup forms for quick data input, and tons of other things. I put each into a root namespace and then create others similar to the .NET namespaces (like MyLibs.Windows.WinForms for my control wrappers or MyLibs.IO.Data for my data abstraction routines). It is just a method to organize the classes so that I can find them easily without innermixing them with the standard classes.

When you add a reference to main exe project it will usually copy the dlls to your output directory. You can specify if you want them copied or not. I usually have them copied.

Also, with DLLs in .NET you do not have the linkage problems you do with C++.

Rocky Moore <><
GeneralRe: creating a single EXE from multiple projects Pin
mikechambers23-Jun-03 15:33
mikechambers23-Jun-03 15:33 
GeneralPretty sticky problem to me... Pin
Weiye Chen22-Jun-03 2:32
Weiye Chen22-Jun-03 2:32 
Generalsomeone clear my mind please Pin
wingcom22-Jun-03 0:29
wingcom22-Jun-03 0:29 
GeneralRe: someone clear my mind please Pin
leppie22-Jun-03 11:23
leppie22-Jun-03 11:23 
GeneralDataGrid Navigation &quot;+&quot; Pin
vladmihai22-Jun-03 0:02
vladmihai22-Jun-03 0:02 
GeneralOutlook interop Pin
WillemM21-Jun-03 23:56
WillemM21-Jun-03 23:56 
QuestionSetting environment variables from installer? Pin
mikechambers21-Jun-03 12:01
mikechambers21-Jun-03 12:01 
AnswerRe: Setting environment variables from installer? Pin
Burt Harris21-Jun-03 12:36
Burt Harris21-Jun-03 12:36 
GeneralRe: Setting environment variables from installer? Pin
mikechambers21-Jun-03 14:55
mikechambers21-Jun-03 14:55 
GeneralRe: Setting environment variables from installer? Pin
J. Dunlap21-Jun-03 16:45
J. Dunlap21-Jun-03 16:45 
GeneralRe: Setting environment variables from installer? Pin
mikechambers21-Jun-03 18:10
mikechambers21-Jun-03 18:10 
AnswerRe: Setting environment variables from installer? Pin
jlb1-Jul-03 14:27
jlb1-Jul-03 14:27 
GeneralRe: Setting environment variables from installer? Pin
mikechambers1-Jul-03 15:26
mikechambers1-Jul-03 15:26 
Generalvideo overlay screen grab Pin
grv57521-Jun-03 4:38
grv57521-Jun-03 4:38 
Generalsending meeting request Pin
jbreiding21-Jun-03 2:09
jbreiding21-Jun-03 2:09 
GeneralObjectOutputStream. (Java vs C#) Pin
Uploader21-Jun-03 1:58
Uploader21-Jun-03 1:58 
GeneralRe: ObjectOutputStream. (Java vs C#) Pin
leppie21-Jun-03 4:27
leppie21-Jun-03 4:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.