)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
First, how to judge a single linked list is a ring? (Note that you cannot use the flag bit, up to two extra pointers) to struct node {char val; node* next;} BOOL Check (const node* head) {}//return false: No ring; True: There is an O (n) method that is (make two pointers, one step at a time, one increment of each step, and if there is a ring, the two must overlap, and vice versa): BOOL Check (const node* head) {if (head==null) return false; Node *low=head, *fast=head->nex
1. RAC action: Used to bind a signal to an attribute of an object, as long as the signal content is generated to assign the content to the property value RAC (_label, text) = _textfield.rac_textsignal; 2.RACObserver (self, name): Whenever the property of this object changes, it generates a signal [Racobserve (Self.view, frame) subscribenext:^ (id x) { NSLog (@ "changed"); }]; 3. @weak (OBJC) and @strong (OBJC) Role: Resolve each other strong references//not add @ will errorWeak pointers@weakify
In some cases, you may want to perform one or more operations in a macro only when the specified condition is true. For example, if a macro is used to verify data in a form, the corresponding information may be displayed to respond to certain input values of the record, and the other information to respond to different values. In this case, you can use conditions to control the macro process.
The condition is a logical expression. Macros are executed
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.