Hello, in the past i've used MS VC++ v6, however since uni this year are going to teach us .NET i thought it would be a good idea to grab a copy of visual studio.net , however when opening my old *.cpp files they dont wanna run. the blue run icon is faded awsay hence i cant click it. what do i do?

Thanks

John

Recommended Answers

All 3 Replies

Hello, in the past i've used MS VC++ v6, however since uni this year are going to teach us .NET i thought it would be a good idea to grab a copy of visual studio.net , however when opening my old *.cpp files they dont wanna run. the blue run icon is faded awsay hence i cant click it. what do i do?

Thanks

John

With .NET you really don't open .cpp files, unless you only want to edit the file. What you need is a solution and project for the .cpp files. You can create a new project from the "Start Page", then select "Win32 project", (check the location shown to make sure it is where you want it to be), then click on OK. The next screen select "Application Settings" then click "Console application" and "Empty project" radio buttons and click finish. You will then have a "solution" and "Project". In the project will be folders which are where your .cpp files need to be. You will see these folders in the "Solution Explorer" window. In Windows explorer copy your .cpp files to the location of you project and then in the Solution explorer when you right click you can select "Add Existing Item" to add the files to the project.
Im sure this is all very cloudy but when you have done it several times it becomes quite simple. You will need to be careful of where you rename items such as the solution name, project name, and names of the .cpp files.
Randy

With .NET you really don't open .cpp files, unless you only want to edit the file. What you need is a solution and project for the .cpp files. You can create a new project from the "Start Page", then select "Win32 project", (check the location shown to make sure it is where you want it to be), then click on OK. The next screen select "Application Settings" then click "Console application" and "Empty project" radio buttons and click finish. You will then have a "solution" and "Project". In the project will be folders which are where your .cpp files need to be. You will see these folders in the "Solution Explorer" window. In Windows explorer copy your .cpp files to the location of you project and then in the Solution explorer when you right click you can select "Add Existing Item" to add the files to the project.
Im sure this is all very cloudy but when you have done it several times it becomes quite simple. You will need to be careful of where you rename items such as the solution name, project name, and names of the .cpp files.
Randy

arr thankyou, now when I run it , it complies sucessfully. However when the console windows runs it imediately closes again, any ideas?

I'm not sure what you are trying to do. Is it that the code exucutes and closes/ends? Try putting as a last line in main cin >> x; just to have the code wait for a keyboard input. (x can be an int variable.)
Randy

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.