Hi guys :)

I'm currently trying to do something I don't have any experience with, and I did not really understand what ixQuick found for me .. So I try here, hoping someone shouts 'oh, done this million times, it's a piece of cake' ;)

So, I'm using Visual Studio and want to run 2 projects simultaneously - therefore I put them in one solution, set both as Startup projects (multiple startup projects), and configure the main project as an .exe, the additional project as .dll. Now I want my main project to consider also the results of the second one so I can access them (the second project is a parser putting objects in vectors I want to use) I read I should "add a reference to the Class library". How do I do that?? I'm clueless ..

Thanks a lot in advance :)

A DLL can not be used as a start application because it isn't an application. A DLL is nothing more than a collection of functions and classes that can be shared among multiple applications. A DLL itself can do nothing.

You can only set one of the projects in a solution as the Startup applicaiton. Only executable programs (with *.exe file extension) can be declared like that. (This is not the same thing as debugging a DLL).

This article explains VC++ 2010 Solutions in detail.

Hey :)

Thanks a lot, it worked. Or at least I could compile and run without any error messages.

I would have another question though. How do I access the objects parsed from the input file by the second project (the one that is configured as .dll)? Can I simply create an object of a class of the second project in the main of the first one? Like ..

int main(){

   Object1_Of_Class_Project1 = new Class_Project1();
   Object1_Of_Class_Project1->Function1();
   Object1_Of_Class_Project1->Function2();

   Object1_Of_Class_Project2 = new Class_Project2();
   Object1_Of_Class_Project2->Function1_Project2(); // Reads file
   Object1_Of_Class_Project2->Function2_Project2(); // Puts file lines in LineList

   for (item in LineList){
      do anything with line;
   }
}

Or how would I do that?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.