Click here to Skip to main content
15,921,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I've been using Visual Studio 2005 for many years and recently upgraded to VS2010 and upgraded computers/OSes. My old VS2005 project built/debugged/ran fine.

1) I have a large number of "non-standard" C++ file names (with suffix of .cp, not .cpp/.hpp). While VS2010 compiles these just fine, Intellisense doesn't recognize them as C++ files nor will the debugger allow me to place a breakpoint in any source within .cp files (.c and .cpp files are okay). The .cp suffix has been added to Tools > Options > Projects and Solutions > VC++ Project settings as an "Extensions To Include". Besides changing the suffix of all 500+ files, is there a way for VS2010 to respect these files as equivalent to .cpp files for the 2 cases? In VS2005, these files worked with both Intellisense and debugger.

2) I use a couple of 3rd party 32bit DLLs. The application builds/debugs/runs with VS2010 on WinXP on 32-bit computer. The application runs with VS2010 (if launched from Explorer). However, if I attach to the running process from VS2010 (with elevated privileges), breakpoints set in my C++ code are not respected. Breakpoints set in C code are respected.

3) When my application is launched from VS2010 (Debug > Start Debugging OR Debug > Start Without Debugging), the application fails to get very far in the startup process. Based on testing, it appears to be the case that the wrong DLLs are being loaded (64 bit WOW instead of 32-bit). This problem does not occur when launching application from Explorer, so I can only conclude that VS2010 is changing the DLL search path thinking my application is a 64-bit application (and not a 32-bit application). I have targeted Win32/x86 as my platform, and confirmed that my Configuration Properties for the Linker is MachineX86. I am not using CLR. I did not install Itanium 64bit compiler/libraries when installing VS2010 (I first installed it, saw this behavior, uninstalled VS2010, and reinstalled without 64bit compiler/libraries to see if it mattered).

I am using VS2010 Premium Version 10.0.30319.1 RTMRel with the Hotfix for Microsoft Visual Studio 2010 Premium & Security Update for Microsoft Visual Studio 2010 Premium installed. Windows 7 Enterprise with Service Pack 1 is also installed. Running on Lenovo W520 with 8GB RAM and i7-2720QM CPU.

1. You probably need to add the extension to the Text Editor section of the Options. You can add cp as a C/C++ type. This might help with the intellisense and debugging.

32 and 64 bit dlls are a pain in VS2010 running on a 64-bit OS. Many times the project types are set to Any CPU for C# projects or x64 for C++ ones. You have to make sure to compile as x86 if you are linking to 32-bit dlls. We have to do that for work all the time.
Share this answer
Renaming the .cp files to .cpp is very easy and fast. Use a command prompt (cmd) and change to the directory containing the files. If you have several sub-directories under the same root that have .cp files, change to the root directory). In the command window type
rename *.cp *.cpp /s

Hope this helps.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900