• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

MS VS IDE mysteries

This awesome development environment has presented me with some mysteries. Like, for example, why it will save edited code even when I don't want it saved (and therefore haven't pressed the "save" button).

Or why I can't simply open up a code file from somewhere on my machine without ruining the project i'm trying to open in.

But today's mystery is a new one. Now, when I try to open up a project that I've created, built, debugged and saved in one day without ever changing a directory, if I reopen it after shutting down, and try to access the code on my .cpp, it opens as a text file. Then I have to copy it and paste it in a new cpp.

I'm sure there's a simple fix to this, but I haven't got half a week to try to figure it out with work, class, etc.

Can anyone address this?

Thanks in advance.
 
What version of VS has been giving you these problems?
Are you adding the cpp file to a project, which is housed in a solution or just "adding a new file"?

Let me know. Maybe I can help you with those idiosyncrasies.


Also about the others ....
VS does not want to build unsaved stuff. Hence, it saves the files during a build. It is also a helpful feature incase VS does something buggy and has to crash ... good thing VS saved your work before crashing. Imagine how annoying it would be if it didnt ....

If you want to change the way CPP files open up by default you can change the settings. The problem usually is that files are associated with applications, so they open up by default in those applications. You can change this setting for header/source files but choose VS as the default application for project and solution files. Then you should be fine.

I hope that helps, let me know about the VS version.
 

DominiConnor

Quant Headhunter
I think the mysterious saves are due to the fact that VS saves your code to disk before compiling or debugging it.
 
Suppose I want to create a new version of my project. I am under the impression that it's not as simple as a "save as" operation. I've tried that once and the results were a little scary.
 
My approach may be thoroughly unhelpful, but what I've done in the past is just copy the .csproj (or whatever it's called) and hack the file to agree with the new name, then create a new blank .sln and pull in the new .csproj into it.

Thank goodness Microsoft isn't using binary files for this stuff.
 
Really? I was thinking that, with all the other bells and whistles this thing has, there would be a provision for doing this that would be straightforward.

While I'm at this, is just me, or would it not be cool to be able to open different windows for different functions and subroutines in the same project? And a more graphic environment; i.e. I want to color code all my functions of one type, and maybe draw a box around the lines of a particular routine...

My approach may be thoroughly unhelpful, but what I've done in the past is just copy the .csproj (or whatever it's called) and hack the file to agree with the new name, then create a new blank .sln and pull in the new .csproj into it.

Thank goodness Microsoft isn't using binary files for this stuff.
 

alain

Older and Wiser
While I'm at this, is just me, or would it not be cool to be able to open different windows for different functions and subroutines in the same project? And a more graphic environment; i.e. I want to color code all my functions of one type, and maybe draw a box around the lines of a particular routine...

Real coders use VI.... :)
 
While I'm at this, is just me, or would it not be cool to be able to open different windows for different functions and subroutines in the same project?
You can store your functions in different files then they will be opened in separate windows.

And a more graphic environment; i.e. I want to color code all my functions of one type, and maybe draw a box around the lines of a particular routine...

Instead of coloring functions of one type, put them into classes and store classes in separate header files.

For drawing boxes around lines use MS Word.

I use Visual Assist from WholeTomato Software - it extends usability of Studio IDE and I don't think I need something more (except larger screen size))))
 

alain

Older and Wiser
VI VI VI = 666
ie: the number of the beast.;)

Use Emacs instead. :prayer:

Emacs... right... you know what emacs stands for, right? "Escape Meta Alt Control Shift". It looks like you want us to get carpal tunnel syndrome.
 
Really? I was thinking that, with all the other bells and whistles this thing has, there would be a provision for doing this that would be straightforward.


I'm not saying there isn't one. Honestly I didn't investigate. I've been using VC++ since ummmm 5.1 (or was it 4.1 *gulp*) and just had too many bad experiences with cloned projects that just don't quite work. Maybe there is a new way to do these, but you said earlier that when you saved it to a new name it did strange things, and when you said it I chalked it up as being par for the course.

And back to editors, VS 2005 makes a half-baked attempt at an EMACS keyboard mapping which I use. VI is suspiciously absent. As for me, I don't want to type an 'i' whenever I want to type.
 
Top