.net写的jsTextEditor控件,如何在delphi中调用?
1、注册dll
D:\>C:\Windows\Microsoft.NET\Framework\v2.0.50727\regasm STTextEditor.dll /tlb:STTextEditor.tlb
2、导入类型库
delphi
project-->import type Library...-->定位到STTextEditor(Version 1.0)-->Create Unit
3、测试代码:
procedure TForm1.Button1Click(Sender: TObject);
var
t1:TTextEditorControl;
begin
t1 := TTextEditorControl.Create(nil);
with t1 do
try
parent := Form1;
Top := 10;
Left := 10;
Width := 400;
Height := 300;
finally
free;
end;
end;
像上面这样操作之后,就出错了,编译的时候提示
[Error] Unit1.pas(32): Incompatible types: '_Control' and 'TForm1'
请帮忙看看