الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

إدراج الفورم في ملف dll أو ما شابهه

مغلق
بدأه jrahma في 16 أغسطس 2004 · 5 رد · 1,164 مشاهدة · في لغة Delphi
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

لدي برنامج لأكثر من عميل وأريد أن أجعل كل فورم في البرنامج في ملف مستقل حتى لا أضطر إلى تحديث البرنامج كاملاً في كل مرة مع أن التغيير قد يطرأ على فورم واحدة فقط!!

ما هي أنسب طريقة لعمل ذلك؟ هل ملف dll مثلاً هو أفضل حل؟ وكيف يمكنني عمل ذلك؟

#2

يا جماعة

هل من أحد يساعدني في هذا الموضوع رجاء

#3

مرة أخرى أطلبب ردا لو سمحتم

كيف يمكنني تخزين الفورم في ملف مستقل لاستدعائها من الملف الرئيسي بحيث يكون لكل فورم اسم معين يتم استدعاؤها به

وما هي أنسب صيغة؟ هل dll؟ أو ملف exe مستقل لكل فورم (أعتقد أن هذا سيكون قاتلاً للكمبيوتر!!)؟

وهل من الممكن لو تركم أحد من الأخوة أن يضع مثالاً مبسطاً هنا....

#4

يمكنك عمل dll لعمل نافذة جديدة عند الطلب باستخدام Win32 api او اعتقد ان عناك Class خاص في ال delphi يمكنك من صنع و اظهار اي عدد من النوافذ

ابحث في جووجل صديق المبرمج

راكان الحنيطي

Be Open Source

opensource-550x4752.gif

#5

لكن هذا يعني أنني أكتب كل شيء برمجياً.

هل توجد طريقة لصنع الفورم في الدلفي ثم تحويلها إلى dll؟

أو صنع الفورم في الدلفي ثم خلق مشروع dll ونسخ الكود الخاص بالفورم هناك؟

#6

انت مبرمج دلفي فبتالي كل ماتريد متاح بين اناملك

نعم تستطيع ان تجعل الفورم في ملف dll وتستطيع ان تستدعيها في تطبيقك

وهي احدى الطرق السهلة لتقليل حجم البرنامج

اليك هذا الكود

library test;

{ 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,
  Unit1 in 'Unit1.pas' {Form1};

{$R *.RES}
procedure showform;stdcall;
var
        f:Tform1;
begin
        f:=Tform1.Create(nil);
        f.ShowModal;
end;
exports
        showform;
begin
end.

This is unit1 in dll project

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
        self.caption:='Hello World';
end;

end.


من هنا تستطيع ملف dll المذكور اعلاه.

unit Unit11;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
procedure showform;stdcall;external 'test.dll';
implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
        showform;
end;

end.

هذا الموضوع مغلق.

مواضيع مشابهة