因为我用我的Delphi应用程序许多帧我的最后一个项目,所以我决定要创建的dll并把它们的动态链接库(Delphi中所有已创建)德尔福exe文件和dll不与运行时包建立
我有内部通过许多网站,并提出了可用的代码,但对于这个例子,我必须编译构建与运行包这两个应用程序和dll,这意味着我必须分发bpls也。如果不要检查建立与运行软件包的错误来了
这是我在DLL中找到
在EXE
procedure TForm1.Button1Click(Sender: TObject);
type
TGetTheFrame =Function(Owner: TComponent; TheParent: TWinControl): TFrame; stdcall ;
var
GetTheFrame : TGetTheFrame;
begin
try
GetTheFrame(application,TabSheet1).Free ;
except
end;
frm := GetTheFrame(application,TabSheet1) ;
dllHandle := LoadLibrary('project1.dll') ;
if dllHandle <> 0 then
begin
GetTheFrame := GetProcAddress(dllHandle, 'GetTheFrame') ;
frm := GetTheFrame(application,TabSheet1) //call the function
{ ShowMessage('error function not found') ;
FreeLibrary(dllHandle) ; }
end
else
begin
ShowMessage('xxxx.dll not found/not loaded') ;
end
Function GetTheFrame(Owner: TComponent; TheParent: TWinControl): TFrame; stdcall;
Begin
Result := TFrame2.Create(Owner);
Result.Parent := TheParent;
End;
这就是所有的代码,但我想这个代码没有运行时包的工作
但我确定代码是好的,因为它与runtimw = e软件包一起工作 – VibeeshanRC 2010-10-21 12:43:32
第一个GetTheFrame调用的目的是什么?如果它的目的是做任何事情,而不是随意地摧毁你的记忆,那么你就错了。编译器应该警告你在那里使用一个未初始化的变量。 – 2010-10-21 12:50:32
在你之前的问题中看到我的答案:http://stackoverflow.com/questions/3985256/how-to-use-delphi-dlls-without-enabling-build-with-runtime-packages我认为这个问题是重复的。 – 2010-10-21 12:52:36