none
.cpp file open with notepad

    Question

  • Hello!

    i was working on a C++ project ,but suddenly my system crashed !

    Now i try to open that project,but Visual studio opens a blank notepad file.

    also tried to view code by openin the solution explorer, but VS shows an error message that cannot open file.

    if i dont find any solution of this problem i have to start my project from the beginning.

    I have VS 2012 on Win8.

    Thank you!


    verify

    Monday, August 26, 2013 1:40 PM

Answers

  • Hello,

    Glad to receive your reply.

    As I mentioned above, if you try to restart your PC, run VS2012 as Admin and then create a new Visual C++ project, whether you still can get this issue?

    If yes, I doubt that it is related to your VS environment.

    If you are not using VS Express, you could locate to the IDE folder then run these commands to check if it can help:

    • Please open Windows Explorer, and navigate to  <Visual Studio Installation Path>\Common7\IDE (by default is C:\Program Files \Microsoft Visual Studio 11.0\Common7\IDE);
    • Devenv.exe /SafeMode: Launches the IDE in safe mode loading minimal windows.
    • Devenv.exe /ResetSettings: Restores the IDE's default settings, optionally resets to the specified VSSettings file.
    • Devenv.exe /ResetAddin: Removes commands and command UI associated with the specified Add-in.
    • Devenv.exe /ResetSkipPkgs: Clears all SkipLoading tags added to VSPackages.
    • If no help, I suggest you try repairing your VS.

    If this issue only occurs at the specific C++ project, whether there are some changes at this .cpp file before you operate it?

    If still no help, my final suggestion is uninstalling VS and then reinstalling it.

    Best regards,


    Amanda Zhu <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by admiri92 Wednesday, August 28, 2013 10:34 AM
    Wednesday, August 28, 2013 1:56 AM

All replies

  • Hello,

    Thank you for your post.

    “also tried to view code by openin the solution explorer, but VS shows an error message that cannot open file.”

    Which error messages do you get in Visual Studio? Please post here so that we can further look at this issue.

    If you want to open a C++ project in Visual Studio, you can right click the a Visual Studio Solution file(.SLN file) or VCXPROJ file and open it with Visual Studio 2010/VS2012. Please try to open that project through this way to check the result.

    I suggest that you try to restart your PC, run VS2012 as Admin and then create a new Visual C++ project, whether you can create it successfully?

    Best regards,


    Amanda Zhu <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Tuesday, August 27, 2013 5:42 AM
  • in solution explorer, right click on ".cpp"  source file ,and  i selected 'view code'.

    here is the error message :

    ( i had created two cpp files ,which just one of them cannot be opened)

    I tried opening .sln file with VS 2012 , but the same problem again with that project.

    Thanks!


    verify

    Tuesday, August 27, 2013 4:44 PM
  • Hello,

    Glad to receive your reply.

    As I mentioned above, if you try to restart your PC, run VS2012 as Admin and then create a new Visual C++ project, whether you still can get this issue?

    If yes, I doubt that it is related to your VS environment.

    If you are not using VS Express, you could locate to the IDE folder then run these commands to check if it can help:

    • Please open Windows Explorer, and navigate to  <Visual Studio Installation Path>\Common7\IDE (by default is C:\Program Files \Microsoft Visual Studio 11.0\Common7\IDE);
    • Devenv.exe /SafeMode: Launches the IDE in safe mode loading minimal windows.
    • Devenv.exe /ResetSettings: Restores the IDE's default settings, optionally resets to the specified VSSettings file.
    • Devenv.exe /ResetAddin: Removes commands and command UI associated with the specified Add-in.
    • Devenv.exe /ResetSkipPkgs: Clears all SkipLoading tags added to VSPackages.
    • If no help, I suggest you try repairing your VS.

    If this issue only occurs at the specific C++ project, whether there are some changes at this .cpp file before you operate it?

    If still no help, my final suggestion is uninstalling VS and then reinstalling it.

    Best regards,


    Amanda Zhu <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by admiri92 Wednesday, August 28, 2013 10:34 AM
    Wednesday, August 28, 2013 1:56 AM
  • Hello!

    When i create a new project i dont get that issue again, I occur this problem just in a C++ file ,that i've called "golf.cpp", other project and files works OK.

    Every time i open devenv.exe it get closed immediately without letting my to run commands.

    I deleted permanently that file and created a new one with the same name, and writted the code again.

    Now it's Ok.

    Thank You!


    verify

    Wednesday, August 28, 2013 10:33 AM