Saturday, May 22, 2010

Visual C++ 2005 Question?

When I make a New -%26gt; Project and make it empty. Then I add a new Item my program run and builds fine but when I add another item (so I have 2 pages in my classWord folder) and make another program it will not run. How can I have more than 1 item in my Projects?

Visual C++ 2005 Question?
You can add more *.cpp files to the project, but only one of those can have a the main method. If you want to have multiple programs each with a main method, you need to make separate projects.
Reply:Yes. You can have lots of different "projects" under one "solution." Be sure in the solution explorer to have the projects on the same folder level. Don't go placing one project under another--unless that's what you're building.





Also, remember that each project has lots of other files--not just the cpp and h files. The resource files, etc have to be kept together. Don't go moving the cpp files under different directories.
Reply:do u mean try run 2 pages as in 2 seprate programs u cant





2 pages only for 1 using a seprate class or split as in partial class for each 1 so u can design on 1 and main code on other you cant run 2 seprate programs 1 on each page in same project





how ever if u are tryin to just write a diffrent class give it same namespace name and works lot easier





u cant have to main()





if you just want to run a diffrent class all you have to do is call it


myclassword."class name"."void name"(any args)


No comments:

Post a Comment