Visual c ++. Net involves multiple programming methods such as ATL/ATL server, MFC, and hosting C ++. It is not only powerful but also widely used. In programming, we often encounter Character String Conversion operations for different encoding types of ANSI, Unicode, and BSTR. This article first introduces the basic string type, then describes the related classes, such as ccombstr, _ bstr_t, and cstringt, and finally discusses their conversion method
-N No Logging no logs-U unbuffered Logging non-buffered log-B Buffered Logging buffer log-a unbuffered Logging, mode ANSI ANSI modesNo Logging no logs----"No log" mode writes only a small amount of information to the logical log, which records only the DDL statements that are executed, and the rows affected by the statements are not written to the log, only the command itself and the code that is returned.
notepad files in Unicode, ANSI, UTF-8, or Unicode format before high. These formats provide you with more flexibility when using documents of different character sets.
Notepad is a basic text editor used to create simple documents. Notepad is most commonly used to view or edit text (.txt) files. However, many users find that notepad is a simple tool for creating web pages.
Because notepad only supports basic formats, you cannot occasionally save
notepad files in Unicode, ANSI, UTF-8, or Unicode format before high. These formats provide you with more flexibility when using documents of different character sets.
Notepad is a basic text editor used to create simple documents. Notepad is most commonly used to view or edit text (.txt) files. However, many users find that notepad is a simple tool for creating web pages.
Because notepad only supports basic formats, you cannot occasionally save
I. BSTR, lpstr, and lpwstr
In all programming methods of Visual C ++. net, we often use such basic string types, such as BSTR, lpstr, and lpwstr. These data types are similar to the above because of data exchange between different programming languages and support for ANSI, Unicode, and multi-byte character sets (MBCS.
So What Are BSTR, lpstr, and lpwstr?
BSTR (Basic string, basic string) is a unicode string of the olechar * type. It is described as a
functions in any Windows NT dynamic link library (DLL), even if the DLL is not a member of the simulator. Obviously, this is not good because the same functions may be unavailable on handheld PCs (H/PCS) or Windows CE devices, and your software will eventually run on these devices.
When you load a non-Unicode application into a Windows CE Simulator for the first time, you will find that many functions in use are not supported, such as the American National Institute of Standards (
call functions in any Windows NT dynamic link library (DLL), even if the DLL is not a member of the simulator. Obviously, this is not good because the same functions may be unavailable on handheld PCs (H/PCS) or Windows CE devices, and your software will eventually run on these devices.
When you load a non-Unicode application into a Windows CE Simulator for the first time, you will find that many functions in use are not supported, such as the American National Institute of Standards (
and symbols, including the national text, punctuation, graphic symbols, numbers and so on. Common character sets are: The ASCII character set, the GB2312 character set (mainly used for processing Chinese characters), the GBK character set (mainly used for processing Chinese characters), the Unicode character set, and so on.character encoding (Character Encoding): is a set of rules that can be used to pair a character set of natural languages (such as an alphabet or a syllable table) with binary
string, excluding the empty characters that are interrupted. If the window does not have a title bar or text, or the title bar is empty, or the window or control handle is invalid, the return value is zero. To obtain more error information, call the getlasterror function.The function cannot return the edited text in other applications.Note: If the target window belongs to the current process, the getwindowtext function sends the wm_gettext message to the specified window or control. If the targ
I. BSTR, lpstr, and lpwstrIn all programming methods of Visual C ++. net, we often use such basic string types, such as BSTR, lpstr, and lpwstr. These data types are different becauseProgramming LanguageData exchange and support for ANSI, Unicode, and multi-byte character sets (MBCS.
So What Are BSTR, lpstr, and lpwstr?
BSTR (Basic string, basic string) is a unicode string of the olechar * type. It is described as a Type compatible with automation
backupOntape–s–l 0–b cem2 Change Database "cem2" from-N to-B mode, create level 0 backupOntape–s–l 0–a cem2 Change the database "CEM2" from-N to-a mode to create a level 0 backup# # # #ontape工具在-u,-b,-a three modes in any one of the changes to another do not need to create a system backup; To completely change from log mode to log mode, or vice versa, to create a level 0 backup;Other than thatCreate Database dbname with logCreate DATABASE state is UCreate database dbname with buffered logCreate
. 2. Syntax Create two table A,c first , as shown in(1)ANSI SQL-92 syntax The following query is a cross- join query for table A and C tables SELECT A.A,C.C from ACross JOIN CBecause the a table has 4 rows and theC table has 5 rows, the query generates a result set that contains the data for the 4*5=20 row. Using the ANSI SQL-92 syntax, you need to use the "Crossjoin" keyword between the two tables
accept any arguments, be sure to indicate that the argument is void. rule three beware of using void pointer typesaccording to ANSI (American National standards Institute) standard,You cannot perform algorithmic operations on void pointers, that is, the following operations are not valid:void * PVOID;pvoid++;//ansi: Errorpvoid + = 1;//ansi: ErrorThe //
meaning.3.if Statement Usage NoteHandle the normal situation first, and then deal with the abnormal situation.The code is written so that the normal execution code is clear, and that the infrequently occurring exception handling code does not obscure the normal execution path. This is important for the readability and performance of your code. Because, ifThe statement always needs to be judged, and the normal situation is generally more likely to occur than the exception (otherwise it should be
parameter is void.
Rule two carefully use void pointer type
According to the ANSI (Americannational standards Institute) standard, you cannot perform an algorithmic operation on a void pointer, that is, the following operations are illegal:
void *pvoid;pvoid++; ANSI: ErrorPVOID + 1; ANSI: ErrorThe ANSI standard is
type, you need to force type conversion. In this example, a = (int *) p. In memory allocation, we can see that the void pointer is used: the pointer returned by the memory allocation function malloc is the void * type. When using this pointer, You need to perform forced type conversion, that is, explicitly indicating the type of data (int *) malloc (1024) that the Pointer Points to in the memory) indicates that the void * pointer returned by malloc is forced to point to the memory to store int-
string, excluding the empty characters that are interrupted. If the window does not have a title bar or text, or the title bar is empty, or the window or control handle is invalid, the return value is zero. To obtain more error information, call the getlasterror function.The function cannot return the edited text in other applications.Note: If the target window belongs to the current process, the getwindowtext function sends the wm_gettext message to the specified window or control. If the targ
Void descriptionVoid is "no type", void * is "no type Pointer", can point to any data type.
Void pointer usage Specification① The Void pointer can point to any type of data, that is, the void pointer can be assigned a value to any type of data. For example:Int * pint;Void * pvoid;Pvoid = pint;/* but cannot pint = pvoid ;*/If you want to assign pvoid to another type pointer, You need to force type conversion, for example, pint = (int *) pvoid;
② In ansi
The meaning of voidVoid is "no type" and void * is "no type pointer" and can point to any data type.
void pointer Usage specificationA ①void pointer can point to any type of data, that is, an assignment to a void pointer using a pointer to any data type. For example:int *pint;void *pvoid;PVOID = pint; * * but can not pint = pvoid; */If you want to assign pvoid to other types of pointers, you need to force type conversions such as: pint = (int *) pvoid;
② in the
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.