LoginPrompt not recognised in TSocket and TWebconnection |
|
I have an old Delphi Midas App. LoginPrompt is set true non the Socket and TWeb connections and works as expected.
I make a new test app with TSocketConnection and LoginPrmompt is set true, but the Login dialog does not appear.
So I traced to SetConnected, and I see that RemoteDialogProc is not assigned.
I looked a lot further but could not explain this. Has anyone struck this problem ? As it is not happing in the old App but is happening in NewApp, I assume it is a setting somewhere in my app, but after svereal hours of searching decided to listen to the wisdom of this group.
Thanks in advance,
Tony
procedure TDispatchConnection.SetConnected(Value: Boolean);
var
Username, Password: string;
Login: Boolean;
begin
Login := LoginPrompt and Value and not Connected and not (csDesigning in ComponentState);
if Login then
begin
if Assigned(OnGetUsername) then
OnGetUsername(Self, Username);
if Assigned(RemoteLoginDialogProc) then
if not RemoteLoginDialogProc(Username, Password) then
System.SysUtils.Abort;
end;
inherited SetConnected(Value);
if Login and Connected then
if Assigned(OnLogin)
then OnLogin(Self, Username, Password);
end;
|