MDI CHild 프로젝트 파일을 다음과 같이 하시면 되네요 ...
library ChildDll;
{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }
uses
SysUtils,
Classes,
Forms,
Windows,
Controls,
ChildFormUnit in 'ChildFormUnit.pas' {ChildForm};
{$R *.res}
var
DllApplication : TApplication;
ChildForm: TChildForm;
procedure ChildFormProc(Reason: Integer);
begin
if Reason = DLL_PROCESS_DETACH then
begin
if Assigned(DllApplication) then
begin
Application := DllApplication;
end;
end;
end;
procedure ChildFormCreate(Sender : TApplication); stdcall;
begin
if not Assigned(DllApplication) then
begin
DllApplication := Application;
Application := Sender;
end;
if ChildForm= nil then
begin
ChildForm:= TChildForm.Create(Sender);
MicrobeViewerForm.Show();
end
else
begin
if ChildForm.Showing then
begin
BringWindowToTop(ChildForm.Handle);
end
else
begin
ChildForm:= TChildForm.Create(Sender);
ChildForm.Show();
end;
end;
end;
exports
ChildFormCreate;
begin
DllApplication := nil;
DllProc := @ChildFormProc;
end.
카오스 님이 쓰신 글 :
:
: 말그대로입니다.
:
: mdi child를 dll로 사용할 경우..
:
: 창이 떠있을때..
:
: 호출을 해도 새로운 창이 출력되지 않게
:
: 하려면.. 어케해야 하나요??
:
: 질답란을 뒤져서 나온 방법으로 구현을 해보아도
:
: 잘 되질 않는군여.
:
:
|