Modeless form cannot receive keyboard input in Excel Add-in developed by Delphi

狂风中的少年 提交于 2019-12-24 13:46:41

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!