var
hMutex:THandle;
begin
Application.Initialize;
hMutex:=CreateMutex(nil,false,'MarryNet');
if GetLastError<>ERROR_ALREADY_EXISTS then
begin
Application.Title := 'ÚäÄ°»é½é¹ÜÀíϵͳ';
Application.CreateForm(Tado_conn, ado_conn);
frm_login:=Tfrm_login.Create(nil);
frm_login.ShowModal;
Application.Run;
end;
ReleaseMutex(hMutex);
end.
在login form 中点击取消
程序就出错!
取消执行:Application.Termation各位高手怎么解决?
hMutex:THandle;
begin
Application.Initialize;
hMutex:=CreateMutex(nil,false,'MarryNet');
if GetLastError<>ERROR_ALREADY_EXISTS then
begin
Application.Title := 'ÚäÄ°»é½é¹ÜÀíϵͳ';
Application.CreateForm(Tado_conn, ado_conn);
frm_login:=Tfrm_login.Create(nil);
frm_login.ShowModal;
Application.Run;
end;
ReleaseMutex(hMutex);
end.
在login form 中点击取消
程序就出错!
取消执行:Application.Termation各位高手怎么解决?
var
hMutex:THandle;
begin
Application.Initialize;
hMutex:=CreateMutex(nil,false,'MarryNet');
if GetLastError<>ERROR_ALREADY_EXISTS then
begin
Application.Title := 'ÚäÄ°»é½é¹ÜÀíϵͳ';
Application.CreateForm(Tado_conn, ado_conn);
frm_login:=Tfrm_login.Create(nil);
try
if frm_login.ShowModal<>mrok then
Application.Termation;
finally
frm_login..free;
end;
Application.Run;
end;
ReleaseMutex(hMutex);
end.
//注意:login form 中的取消按钮设置它的modaltrsult属性为:mrCancel就行不需要任何事件,而确定按钮的事件为:如果登录成功则:modalresult:=mrok;就可以了.
close;
application.termation;试试
hMutex:THandle;
begin
Application.Initialize;
hMutex:=CreateMutex(nil,false,'MarryNet');
if GetLastError<>ERROR_ALREADY_EXISTS then
begin
Application.Title := 'ÚäÄ°»é½é¹ÜÀíϵͳ';
Application.CreateForm(Tado_conn, ado_conn);
frm_login:=Tfrm_login.Create(nil);
try
if frm_login.ShowModal=mrok then
Application.Run;
finally
frm_login..free;
end;
end;
ReleaseMutex(hMutex);
end.
//注意:login form 中的取消按钮设置它的modaltrsult属性为:mrCancel就行不需要任何事件,而确定按钮的事件为:如果登录成功则:modalresult:=mrok;就可以了.
出错:Undeclared identifiers 'mrok'