2009年4月22日 星期三

Microsoft Visual Studio 2008 Tips

* How to add command parameter in the Microsoft Visual Studio while compiling the code and debug.
Select Project > Project-Name-Property (Alt-F7) > Configuration Property > Debug > Command-Parameter
Input the command parameter here and it will redirect to the execution file while debugging
e.g -a 123

* How to set the definition in the preprocessor
Select Project > Project-Name-Property (Alt-F7) > Configuration Property > C/C++ > Preprocessor > Preprocessor definition
Set the definition here
WIN32;DEBUGMODE

* How to run and debuging test in the MVS
Debug F5
Run without debugging Ctrl + F5

Updated 2009/06/04
* What is the system architecture in the Microsoft Visual Studio?
A. .sln ==> Solution file
.vcproject ==> VC project file
a VC solution consists multiple VC projects

How to distinguish a Win32 AP or other form (e.g. static library or dll ..) in the MVS
A. In the Project Property page
The Default values of project
Configuration type: Application(.exe), static library
The usuage of MFC: Use the standard windows library
ATL usuage: No use ATL
Word Set: Use MultiByte Sets, Use UnicCode Sets

What is the execution file output foler path?
Win32 Application (.exe): Project Property page -> Configuration Property -> Linker -> Command line
Static library: Project Property page -> Configuration Property -> Manager -> Command line
The general settings can be found in the Linker/Manager=>General=>Output Directory

How to link the static library while tring to build a Win32 Application (.exe)?
A.
1. Set the include directory to include the header files of the static library prototype
Project Property page -> Configuration Property -> C/C++ -> other include directory -> set the header file path (Note: the path is dependency to the vc project file)
2. Set the library path and name
Project Property page -> Configuration Property -> Linker -> Input -> Other dependency -> set the library file path (Note: the library path is dependency to the vc project file)

沒有留言: