(...) 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 ()
Use of some macros
_ Attribute __
With a certain standard validation function, type, etc., specific can refer to http://www.cnblogs.com/astwish/p/3460618.html
_ MSC_VER
Microsoft's pre-compilation control selects the compiler version. Different compilers use different function definitions. You can use this macro to select different versions of the compiler in different periods: ms vc + + 10.0 _ MSC_VER = 1600 ms vc + + 9.0 _ MSC_VER = 1500 ms vc
Win32_lean_and_mean
1. Reference:https://msdn.microsoft.com/en-us/library/windows/desktop/aa383745 (v=vs.85). aspx2. Instructions for use:You can reduce the size of the Windows headers files by excluding some of the common API declarations as follows:•Define Win32_lean_and_meanto exclude APIs such as cryptography, DDE, RPC, Shell, and Windows Sockets.Usually when we develop Windows programs, the easy-to-use will directly include the "windows.h" header file, but in fact, many of the header
Hundreds of thousands of tables need to be set to all sizes. Manual is useless.Record the way that Word selects tables in bulkAlt+f8, open the Macro dialog box and create a macro named SelectalltablesSubselectalltables () DimtempTableAsTable Application.ScreenUpdating=False ' Judging if the document is protected IfActiveDocument.ProtectionType=wdAllowOnlyFormFieldsThen MsgBox "The document is protected and you cannot select multiple tables at this time!" "ExitSubEndIf" Delete all editable regio
macro is the preprocessing of C compiler system, what is "pre"? It is the preparatory work before the commencement of the formal work. so a macro substitution is a conversion of a character defined by a macro directly to a subsequent expression before it is compiled to the program.Comma expression: comma operator, the lowest priority, it joins two, can be executed consecutivelyCode: directly to the file output 1-1000 number#include #defineB p,p,p,p,p,p,p,p,p,p#defineP l,l,l,l,l,l,l,l,l,l#define
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.