/******************************************************//**************---about Macro----------**************// ---author:tibruce Zhao---**************//**************---date:2015/7/31------**************//*** /#include Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced. "C + + programs" about macros
when neededExecution speed is faster than the normal function.Of course, the inline function also has some limitations. is that the execution code in the function cannot be too much , if, inlinefunction body is too large, the general compiler will discard the inline mode, and the normal way to call the function. (in other words,That is, you use an inline function, just to make a request to the compiler, the compiler can reject your application)In this way, the inline function is as efficient as
Properties ' VBA properties are features of VBA objects ' means of representing properties of an object are ' object. Property = property Value NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;SUBNBSP;TTT () Range ("A1"). VALUENBSP;=NBSP;100NBSP;NBSP;NBSP;NBSP;ENDNBSP;SUBNBSP;NBSP;NBSP;NBSP;SUBNBSP;TTT1 () sheets (1). name= "worksheet renamed" endsubsubttt2 () sheets ("Sheet2"). Range ("A1"). value= "ABCD" EndSub NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;SUBNBSP;TTT3 () range ("A2"). in
(...) to implement queries.Begin_com_map (x) defines an array mapped to the next static interface:_ Atl_intmap_entry _ entries [];Every interface ing macro is actually added to this array. An interface ing macro consists of three partsPoints: The IID number, offset value (most of the time) of the interface, and the function to be executed, which is not required for general interfaces.Execute other functions. _ Getentries () is the returned array. I will discuss some details later.
8: static hre
this method, both c99 and gnu cpp support the following macro definition methods:
#define myprintf(templt, ...) fprintf(stderr,templt, ##__VAR_ARGS__)
In this case, the # connection symbol is used to remove the comma before when _ var_args _ is empty. The translation process is as follows:
Myprintf (templt );Converted:Fprintf (stderr, templt );
In this way, if the templt is valid, no compilation error will be generated.Incorrect nesting-misnesting
The macro definition does not have to have comp
The following macros are briefly introduced:
1) _ va_args _ is a macro of a variable parameter. The macro of this variable parameter is added in the new c99 specification, currently, only GCC is supported (not supported by the vc6.0 compiler ). # Is added before the Macro. When the number of variable parameters is 0, # is used to remove ",". Otherwise, compilation errors may occur.2) _ file _ Macro will be replaced with the current source file name du
file to test the feasibility.========================================================== =================================== Content:========================================================== ==================================
# Include
Compile, run, debug, and finally succeed. It is feasible.Then, the code is split into several files.========================================================== =================================== The declaration is changed to the following:======================
)Version of the. NET Framework used by Visual Studio. Combined with $ (frameworkdir) is the full path to the version of the. NET Framework that Visual Studio uses.$ (Frameworksdkdir)The directory where the. NET Framework SDK is installed. The. NET Framework SDK can be installed as part of Visual Studio. NET, or separately.$ (Webdeploypath)The relative path from the Web deployment root to the location to which the project output belongs. Returns the same value as RelativePath.$ (WebDeployRoot)The
Software in the work needs to start different video capture hardware in different application scenarios. There are three methods to start:
1. Pre-processing commands and macros are used to process code of different hardware;
2. Identify by hard-coded hardware identification code;
3. Use the UI for user selection;
Let's take a look at the first one.
Understanding # define
Syntax:
# Define ID replacement list# Define identifier [(identifier, select...,
Differences between macros and functions:(1) memory Stack: When the function is called, the address is put into the stack. After the function is executed, the address of the called function is returned from the stack to the program. However, macro expansion directly replaces the macro name with the replacement ID.(2) time effect: calling a function requires on-site protection and recovery. It takes a lot of time, but it does not extend the target prog
Collection of common Macros in Linux Kernel
I. Interruptions:
1. interrupt type: Use # define sa_shirq shared interrupt in request_irq (IRQ, handler, flags, devname, dev_id) (earlier than 2.6.19 kernel) # define irqf_shared interrupt (new version) # define sa_interrupt quick interrupt (earlier version) # define irqf_disabled quick interrupt (new version) # define irqf_sample_random indicates that the current interrupt source can be used as the entrop
") tchar string ). These macro definitions can be directly used in any CPP file.
In resource script resource. RC, if we need version resources, we can first define some Macros in define. H, for example:
# Define str_appname text ("cutefoto ")# Define str_author text ("yonsm ")# Define str_corporation text ("yonsm. Net ")# Define str_web text ("yonsm.reg365.com ")# Define str_email text ("Yonsm@163.com ")# Define str_weburl text ("http: //") str_web# D
1.Print error message
If the execution of a program requires that a macro be defined, you can use # error, # warning to print the error (warning) information when the macro is not defined. For example:
# Ifndef _ UNIX __# Error "This section will only work on UNIX systems"# Endif
The program can be compiled normally only when the _ UNIX _ macro is defined.
2.Easy debugging
_ File, _ line, and _ function are macros predefined by the compiler. They rep
the generated primary output file. It includes "." Before the file extension.
$ (Vsinstalldir)
Install the Visual Studio. NET directory.
$ (Vcinstalldir)
Install the Visual C ++. Net directory.
$ (Frameworkdir)
Directory for installing. NET Framework.
$ (Frameworkversion)
Visual StudioThe. NET Framework version used. Combined with $ (frameworkdir), it is the complete path of the. NET Framework Version Used by Visual Studio.
Writing macros over the past few days is very interesting. If you want to write a document annotation, you can write it into maceos, which is much faster,
Sub annotation ()
Sub Annotation ()DTE. activedocument. selection. Text = " //**************************" DTE. activedocument. selection. newline ()DTE. activedocument. selection. Text = " // * Name :" DTE. activedocument. selection. Text = DTE. activedocument. projectitem ()
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.