1. Add a trace statement to MFC
2. In tools> MFC tracer, select enable tracing and click OK.
3. debug and run go (F5) (Note: not execute '! 'The reason why we couldn't see trace content in the past is that it wasn't debugging, '! ', Remember, remember)
4. The trace content will be displayed in the debug window in the output. The debug execution will automatically jump from the build window to the debug window, where the trace content will be displayed, ^_^
The following is a detailed description
工欲善其事, its prerequisite.Before you formally implement all the cool features and UI, getting ready is the only way to improve the efficiency of your next development.So, this series, I am not in a variety of heap technology, more attention is "Bing" before the "grain line", some cumbersome, but when the whole context is clear, the follow-up work is only on the good Foundation and framework of unlimited expansion and optimization.Macro definition is an effective tool for improving efficiency in th
In addition to the core structure, Google-glog also provides unified and concise interfaces for use through macro techniques.At the same time, the namespace should be used to minimize name conflicts and provide a brief logstore. Macro Assistant
Provides a unified and concise log output interface through macros
Simple use of log output interfaces such as log (Info) and log (error)
1. Why Use macrosJoin you need to repeat something many times, such as checking the source code and sending it to console debugging, can we simplify a series of operations into one step, or even use a set of shortcut keys instead?2. Preparatory work(1) The Pycharm version is 2.7 or higher.(2) Consistent with the behavior in product documentation.(3) Create a project and add at least two scripts to it, see Getting Started and Debugger3. Record macroSelect the Edit→macros→start
I. general usageWe use # to convert the macro parameter into a string, and # to combine the two macro parameters.Usage:# Include # Include Using namespace STD;
# Define STR (s) # s# Define cons (a, B) int (A ## e ## B)
Int main (){Printf (STR (vck); // output string "vck"Printf ("% d", Cons (2000); // 2e3 output:Return 0;}
2. When the macro parameter is ano
Define section:Macros can be used not only to replace constant values, but also to replace expressions or evenCode. (Macros have powerful functions but are prone to errors, so their advantages and disadvantages are quite controversial .)
Macro Syntax:
# Define macro name macro value
Note that the macro definition
Huaqing Vision LecturerIn the process of reading Linux kernel code, especially some pre-processing instructions macros, you will see the macro statement will contain some # or a linked # # symbol, just when the contact felt very confused, but these macro statements sometimes do not open, so in order to better read the code, It is necessary to take a closer look at the meanings of these special symbols.# F
Macros are a collection of commands and are widely used, including the word editor in MS Office, the Excel editor and various text editors, and Vim, one of the most powerful text editors in Linux systems, also supports macro operations, and this section briefly describes the use of macros in Vim, First look at the following macro commands
q* Start Recording macros
Q Stop Recording
Naming conventions for macro names1. All caps have multiple words separated by underscores (commonly used)2. The hump mark starting with K (not commonly used)Macro definition with parameters: Place the name of the macro after the macro name in the parentheses after the argument into the expression after the
When we have a lot of pens to search for in the library, we often use the following syntax
SELECT
*
from member
WHERE
accunt to
(
' Tom ',
' John ', ' may
'
)
In the search terms in the above language, there are three account items of Tom, John, may, and less information, you can also add a single citation to the front of the account and a funny number on the back, but when you have a case of 50 accounts, it's going to take a lot of time to enter a pen.I used to use the CO
If you are a C programmer, you must be familiar with macros, they are very powerful, if used correctly can make your work more effective. Then, if you're defining macros and you're not checking them out at random, then they can make you mad and waste n more time. In many C programs, you may see a number of more specific macro definitions that seem less straightforward. Here's an example:1 #define _set_taks_state (tsk, State_value) 2do {ts
MFC Technical Instructions:
In MFCSDK switch method to process Windows messages,
By message ing table(Message map) and virtual function polymorphism to process the specified form message
1. Declare a message ing table(Message map) Add a macro to the class that can process messages
Declare_message_map () Note:
MFC has a more detailed system overview. Here we only introduce several macro definitions.
Okay, I studied the underlying implementation principle of switch () last night. I found that it is not as mentioned in C language textbooks. Of course, this is for those who are very familiar with assembly, is a piece of cake. In the world, many things are a combination of coincidence and necessity. There is no love for no reason or hate for no reason.-Why am I blocked by a switch? What is the important role of this switch in contiki? Without answering this question, let's take a look at how to
There are two steps: Expand the macro first, and then evaluate the value.
Because there is a macro definition (macro body here) that cannot be evaluated during compilation, the macro parameter is not yet available. Macro parameters must be known only when the compiler sees t
int ys=2012;
if (Is_leap_year (YS))
//Usually the preprocessor is defined on a line if a good branch, for example, is too long to be wrapped, you need to use the symbol "/" to indicate that there is another line, multirow, for example:
#Define Is_ Leap_year year%4==0year%100!=0/
| | Year%400==0
//macro definition parameter put a # then when you call the macro, the preproc
Write a good C language. A beautiful macro definition is very important. Using a macro definition can prevent errors, improve portability, readability, and convenience. The following lists some mature software commonly used macro definitions ......
1. prevent a header file from being repeatedly contained
# Ifndef comdef_h
# Define comdef_h
// Header
a normal function declaration. We must define the function body.
Inline tablefunction (int I) {return I * I };
Application of restrained functions:
Application 1: define access functions for class member variables
Inline functions are the most widely used in C ++ classes and should be used to define access functions. Generally, data members are defined as private or protected in the classes we define. In this way, the outside world cannot directly read and write the data of our class me
), Io:format ("Show M: ~p ~n", [M]).The code it compiles is:Show ({man,_,_,_} = M) when TrueIo:format ("Show M: ~p ~n", [M]).MacroIt's hard to imagine how hard it is to read our Erlang code without a macro, with magic number everywhere; simply summarize the use of macros in Erlang:
Macro constants such as-define (TIMEOUT, 1000). -define (Servername,my_first_game_server).
With macros such as:-define (E
1. nvelocity ParametersExample:1. Establish a macro# Macro (test $ range $ arraylist)...# End2. macro call# Test ([-9,-1] ["favorite", "color"])In the preceding example, you only need a # macro command that provides the name for each parameter to be passed. These parameters are separated by spaces. In the above example
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.