美好的一天,我写的插件在DLL本身dll的 从主窗体调用DLLcxgrid IB DLL德尔福
type
TCreateCustomWindow=function(ParentFrame:TWinControl; ParentHandle:integer; ParentRect:TRect; var WinHandle:THandle):integer; stdcall;
var
CreateW:TCreateCustomWindow;
begin
CreateW:=GetProcAddress(FHLib,'Create_LEF');
if Assigned(CreateW) then
begin
if Assigned(CreateW) then LEFT_OKNO:=CreateW(ScrollBox2, ScrollBox2.Handle, ClientRect, FChildHandle);
end;
,它看起来像
function Create_LEF(ParentFrame:TWinControl; ParentHandle:integer; ParentRect:TRect; var WinHandle:THandle):integer; stdcall; export;
begin
Result:=0;
WinHandle:=0;
try
FD3:=TForm3.Create(nil);
FD3.Parent:= ParentFrame;
Result:=integer(FD3);
WinHandle:=FD3.Handle;
if ParentHandle<>0 then begin
SetParent(WinHandle,ParentHandle);
with FD3 do begin
FD3.Align:=alTop;
FD3.Width:=ParentFrame.Width;
hirina_left:=ParentFrame.Width;
FD3.Show;
end;
end;
except
On E:exception do MessageDlg(E.Message,mtError,[mbOK],0);
end;
end;
的问题是,我可以不是编辑单元格cxGrid可以做些什么错事吗?
在你的代码中没有提及cxGrid(DevExpress网格?),所以很难说。你能发布一些你已经试过的相关代码和一些步骤吗? – Birger 2012-03-06 06:31:02
您无法安全地跨DLL边界传递Delphi对象。 TWinControl参数不好。为什么你需要通过它以及HWND?不知道这与问题相关。 – 2012-03-06 06:31:28
在主程序中我有一个组件ScrollBox,并且必须将这个文件从dll窗体中放置,当你按下按钮“СКРЫТЬ”时,窗体的数量应该减少,在另一个窗体上追上,用代码I提供上面,它的工作原理,但你不能编辑cxGrid下面是截图http://s51.radikal.ru/i132/1203/da/3787a490fd8f.jpg – fedormoore 2012-03-06 11:49:15