问题
Is it bug of VCL?? Non modal form cannot receive input in Excel COM Add in. But the very same code of C# works fine.
Demo: https://drive.google.com/open?id=1eKermBZdgXdT7KtfJeZWxYiUwjDNRAst
C# Demo: https://drive.google.com/open?id=1tdcgkbHU8cExVhHrmFsQeA5oqjlzxN3k
Delphi Code:
procedure TDelphiAddIn1.OnStartupComplete(var custom: PSafeArray);
var
LForm: TForm1;
begin
LForm := TForm1.Create(nil);
LForm.Show;
end;
C# Code:
public void OnStartupComplete(ref System.Array custom)
{
new Form1().Show();
}
Delphi Version: Delphi 10.1 Berlin update2 (1. Steps:Compile the project. 2. Open cmd as Administrator, use regsvr32.exe DLLPath to register the output DLL 3.Open Excel )
来源:https://stackoverflow.com/questions/48434224/modeless-form-cannot-receive-keyboard-input-in-excel-add-in-developed-by-delphi