var
mes: string;
response: integer;
begin
mes := '确定删除 ' + adotable1.fieldvalues['轴承型号'] + '?'; response := application.messagebox(mes, '提示', MB_OKCANCEL)
总是提示messagebox中mes类型应该是pchar,而不是string
请问如何转换?
急。
mes: string;
response: integer;
begin
mes := '确定删除 ' + adotable1.fieldvalues['轴承型号'] + '?'; response := application.messagebox(mes, '提示', MB_OKCANCEL)
总是提示messagebox中mes类型应该是pchar,而不是string
请问如何转换?
急。
response := application.messagebox(pchar(mes), '提示', MB_OKCANCEL);
是一个好方法
var
mes: string;
response: integer;
begin
mes := '确定删除 ' + adotable1.fieldvalues['轴承型号'] + '?'; response := application.messagebox(pchar(mes), '提示', MB_OKCANCEL)
mes: string;
response: integer;
begin
mes := '确定删除 ' + adotable1.fieldvalues['轴承型号'] + '?'; response := application.messagebox(pChar(mes), '提示', MB_OKCANCEL)
pchar -> string: 直接用,会自动转的。
LPCTSTR lpText, // address of text in message box
LPCTSTR lpCaption, // address of title of message box
UINT uType // style of message box
);
参数说明:hWndIdentifies the owner window of the message box to be created. If this parameter is NULL, the message box has no owner window. lpTextPoints to a null-terminated string containing the message to be displayed. lpCaptionPoints to a null-terminated string used for the dialog box title. If this parameter is NULL, the default title Error is used. uTypeSpecifies a set of bit flags that determine the contents and behavior of the dialog box.