在DLL里面的内容,麻烦解释一下,谢谢1、Format到底处理后是什么内容的字符串
2、ControlOfs%.8X%.8X又是什么意思,
3、请给下delphi Format的函数原型,为何GetModuleHandle前面和GetCurrentThreadID后面为什么加中括号?
4、initialization和finalization在C语言里是否是直接定义?initialization
ControlAtomString := Format('ControlOfs%.8X%.8X', [GetModuleHandle(nil), GetCurrentThreadID]);
ControlAtom := GlobalAddAtom(PChar(ControlAtomString));
RM_GetObjectInstance := RegisterWindowMessage(PChar(ControlAtomString));
finalization
GlobalDeleteAtom(ControlAtom);
ControlAtomString := '';
2、ControlOfs%.8X%.8X又是什么意思,
3、请给下delphi Format的函数原型,为何GetModuleHandle前面和GetCurrentThreadID后面为什么加中括号?
4、initialization和finalization在C语言里是否是直接定义?initialization
ControlAtomString := Format('ControlOfs%.8X%.8X', [GetModuleHandle(nil), GetCurrentThreadID]);
ControlAtom := GlobalAddAtom(PChar(ControlAtomString));
RM_GetObjectInstance := RegisterWindowMessage(PChar(ControlAtomString));
finalization
GlobalDeleteAtom(ControlAtom);
ControlAtomString := '';
解决方案 »
- ClientDataSet 创建的字段 名字长度 只能在 31个字符之内
- delphi怎么样屏蔽alt+tap和win键?
- 请问:怎样将Excel另存为html文件
- 如何将一个Treeview中的Treenode表示为可进一步展开的?
- 用CreateService 来创建一个NT服务怎么老失败?
- [请教]为什么delphi6.0中加入kodak的缩略图控制控件后,把控件放到窗体上出错呢?
- TWebConnection调用QueryInterface总是失败,时机制原因,还是用法有误?
- 有关dll的问题,能不能在dll中利用ado对数据库操作?在线等,,,请看代码,
- 如何把启动项目显示在ListView中
- 如何取得局域网的所有机器的IP地址(IP是动态分配的)?
- 求SQL语句
- 如何清空DBGrid里面的数据
[10,'bb',1,1]中的内容依次替换,前的字符串中%d %s %X %.5X'procedure TForm1.Button1Click(Sender: TObject);
begin
showmessage(format('aa%d%s%Xe%.5X',[10,'bb',1,1]));
end;
An optional left justification indicator, ["-"]
An optional width specifier, [width]
An optional precision specifier, ["." prec]
The conversion type character, typeThe following table summarizes the possible values for type:d Decimal. The argument must be an integer value. The value is converted to a string of decimal digits. If the format string contains a precision specifier, it indicates that the resulting string must contain at least the specified number of digits; if the value has less digits, the resulting string is left-padded with zeros.
u Unsigned decimal. Similar to 'd' but no sign is output.
e Scientific. The argument must be a floating-point value. The value is converted to a string of the form "-d.ddd...E+ddd". The resulting string starts with a minus sign if the number is negative. One digit always precedes the decimal point.The total number of digits in the resulting string (including the one before the decimal point) is given by the precision specifier in the format string梐 default precision of 15 is assumed if no precision specifier is present. The "E" exponent character in the resulting string is always followed by a plus or minus sign and at least three digits.
f Fixed. The argument must be a floating-point value. The value is converted to a string of the form "-ddd.ddd...". The resulting string starts with a minus sign if the number is negative.The number of digits after the decimal point is given by the precision specifier in the format string梐 default of 2 decimal digits is assumed if no precision specifier is present.
g General. The argument must be a floating-point value. The value is converted to the shortest possible decimal string using fixed or scientific format. The number of significant digits in the resulting string is given by the precision specifier in the format string梐 default precision of 15 is assumed if no precision specifier is present.Trailing zeros are removed from the resulting string, and a decimal point appears only if necessary. The resulting string uses fixed point format if the number of digits to the left of the decimal point in the value is less than or equal to the specified precision, and if the value is greater than or equal to 0.00001. Otherwise the resulting string uses scientific format.
n Number. The argument must be a floating-point value. The value is converted to a string of the form "-d,ddd,ddd.ddd...". The "n" format corresponds to the "f" format, except that the resulting string contains thousand separators.
m Money. The argument must be a floating-point value. The value is converted to a string that represents a currency amount. The conversion is controlled by the CurrencyString, CurrencyFormat, NegCurrFormat, ThousandSeparator, DecimalSeparator, and CurrencyDecimals global variables, all of which are initialized from the Currency Format in the International section of the Windows Control Panel. If the format string contains a precision specifier, it overrides the value given by the CurrencyDecimals global variable.
p Pointer. The argument must be a pointer value. The value is converted to an 8 character string that represents the pointers value in hexadecimal.
s String. The argument must be a character, a string, or a PChar value. The string or character is inserted in place of the format specifier. The precision specifier, if present in the format string, specifies the maximum length of the resulting string. If the argument is a string that is longer than this maximum, the string is truncated.
x Hexadecimal. The argument must be an integer value. The value is converted to a string of hexadecimal digits. If the format string contains a precision specifier, it indicates that the resulting string must contain at least the specified number of digits; if the value has fewer digits, the resulting string is left-padded with zeros.
Conversion characters may be specified in uppercase as well as in lowercase梑oth produce the same results.
For all floating-point formats, the actual characters used as decimal and thousand separators are obtained from the DecimalSeparator and ThousandSeparator global variables.
Index, width, and precision specifiers can be specified directly using decimal digit string (for example "%10d"), or indirectly using an asterisk character (for example "%*.*f"). When using an asterisk, the next argument in the argument list (which must be an integer value) becomes the value that is actually used. For example, Format('%*.*f', [8, 2, 123.456]) is the same as Format('%8.2f', [123.456]).
A width specifier sets the minimum field width for a conversion. If the resulting string is shorter than the minimum field width, it is padded with blanks to increase the field width. The default is to right-justify the result by adding blanks in front of the value, but if the format specifier contains a left-justification indicator (a "-" character preceding the width specifier), the result is left-justified by adding blanks after the value.An index specifier sets the current argument list index to the specified value. The index of the first argument in the argument list is 0. Using index specifiers, it is possible to format the same argument multiple times. For example "Format('%d %d %0:d %1:d', [10, 20])" produces the string '10 20 10 20'.Note: Setting the index specifier affects all subsequent formatting. That is, Format('%d %d %d %0:d %d', [1, 2, 3, 4]) returns '1 2 3 1 2', not '1 2 3 1 4'. To get the latter result, you have must use Format('%d %d %d %0:d %3:d', [1, 2, 3, 4])
Format('ControlOfs%.8X%.8X',[GetModuleHandle(nil), GetCurrentThreadID])
分别取GetModuleHandle(nil), GetCurrentThreadID俩数的8位精度的十六进制数
E2034 Cannot convert 'void *' to 'const TVarRec *'