Presentation is loading. Please wait.

Presentation is loading. Please wait.

C/C++ Tools & Methodology demonstration He Zongjian School of Software Engineering Tongji University.

Similar presentations


Presentation on theme: "C/C++ Tools & Methodology demonstration He Zongjian School of Software Engineering Tongji University."— Presentation transcript:

1 C/C++ Tools & Methodology demonstration He Zongjian ceoxp@yahoo.com School of Software Engineering Tongji University

2 Agenda  Project management in Visual Studio  Develop Resource lookup  Debugging with Visual Studio  Introduction to Windows GUI Apps  Sample application of C++ project  References  Discussion

3 Project management in Visual Studio

4 Common Bad Habit  Create a *.c / *.cpp file  Open it with Visual Studio  Compile

5 Bad Effect  NO Intelligent Sense  Class View / File View disabled  Can NOT debugging  Can NOT locate definitions An Expensive Notepad

6 What is Workspace & Project  Configuration files that help us managing the project  A workspace can have multiple project  Workspaces have the.dsw extension  Projects have the.dsp extension  Double click the workspace can auto launch the Developer studio

7 Other files used by devenv .ncb : Visual C++ IntelliSense Database .rc : Resource template .pch : Precompiled header .obj : Intermediate file .pdb : Program debugging database .bsc : Browse information .clw : Class wizard file (MFC only)

8 Using File View & Class View  File View : –Add new file –Delete file  Class View : –Locate functions & variables –Add new class –Add member functions and member variables

9 Project configuration  Debug version VS Release Version  Enable RTTI  Command line arguments

10 Useful Tips  Code auto formatting (Alt + F8)  Go to definition  Go to reference  Find in files  Open document

11 New features in VS.NET .dsw ->.sln  Integrated IDE  Measure up to C++ standard  ……

12 Develop Resource lookup

13 Microsoft Developer Network (MSDN)  All develop related resources  Online Version: –http://msdn.microsoft.com http://msdn.microsoft.com –Released every 4 months  Visual Studio 6.0 Version (.chm) –VB 6, VC 6, VFP 6, VJ 6, VID 6, Platform SDK  After Jan 2002, Visual Studio.NET Version –.NET framework

14 Demo : How to use MSDN

15 Other Resources  Knowledge Base –http://support.microsoft.com http://support.microsoft.com  TechNet –http://technet.microsoft.com http://technet.microsoft.com  Developer Works (IBM) –http://www.ibm.com/developerworks/ http://www.ibm.com/developerworks/

16 Debugging with Visual Studio

17 What is debugging?  A process for identifying the root cause of a problem by tracing program execution flow and underneath memory status.  Beneficial after performing general troubleshooting steps.

18 Basic debugging knowledge  Symbols : The PDB files generated with your binaries by VS  Debugging tools –Visual Studio –Windbg / CDB ( For Windows ) –Debug ( For MS-DOS ) –Gdb ( For Linux / Unix / AIX )

19 Common Debug Scenario  Logic Error  Memory Leak  Access Violation (AV)

20 Basic Methodology  Set break point  Step into / Step over / Step out  Variables monitor (Local / Watch / Auto)  Call stack  Memory  Register  Disassembly

21 Demo : How to use Visual Studio.NET to debugging

22 Advanced Methodology  Conditional Breakpoint  Remote debugging (GDI / Kernel)  JIT debugging  Debugging running process  Debugging crash dump  Multithread debugging

23 Demo : Conditional Breakpoint Attach to a process

24 Solving Access Violation  Buffer Overflow / Underflow –Heap Corruption –Stack Corruption  Memory Access Denied –Raw Pointer –Double Free

25 The Hint  Debuggers are just tools  We must also : –Know the product –Know the languages and their implications (compiler implementation) –Know the operating system –Know the CPU –Know the tools

26 Introduction to Windows GUI Applications

27 What does GUI App Contains  Entry Point : WinMain  Register a window class  Create and Show a Window  Message Loops  Windows Procedure (WinProc)  Resource Template

28 Demo : Create and analyze a GUI application

29 Sample application of C++ project

30 Demo : Text Miner 1.0 Cheat Killer 0.02 Demo : Text Miner 1.0 Cheat Killer 0.02

31 References

32 C / C++ references  Thinking in C++ 2nd Edition Bruce Eckel  C++ Primer Stanley B.Lippman  The C++ Programming Language 3rd Edition Bjarne Stroustrup

33 C / C++ references (Cont’d)  The C++ Standard Library 侯捷 译  STL 源代码剖析 侯捷 著  The C++ template David Vandevoorde  Inside C++ Object Model Stanley B.Lippman

34 GUI Programming  Programming Windows 4 th Edition Charles Petzold  MFC Windows 程序设计 2 nd Edition Jeff Prosise  Programming Microsoft Visual C++ David J. Kruglinski

35 Debugging References  Debugging Application John Robbins  Debugging Applications for Microsoft.NET and Microsoft Windows John Robbins  Debugging Windows Programs Everett N. McKay

36 Discussion

37 © 2003 Tongji University. All rights reserved. This presentation is for informational purposes only. TJSSE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY. Thanks! Question?


Download ppt "C/C++ Tools & Methodology demonstration He Zongjian School of Software Engineering Tongji University."

Similar presentations


Ads by Google