我想把一个窗体封装为DLL。现在我的工程文件的代码为 :
library ProDLLfrm;uses
  DLLfrm in 'DLLfrm.pas' {DLLForm};exports
  Showcalendar;   //导出函数可显示窗体。beginend.
我在DLLfrm单元中也定义了Showcalendar这个函数,可是编译的时候为什么提示Showcalendar没有定义呢?

解决方案 »

  1.   

    在你的单元文件dllfrm的exports中写上函数名试试
      

  2.   

    在use 下插入以下代码
      Forms,
      Dialogs,在{$R *.res}下插入以下函数就可以了
    procedure Showcalendar(Sender:Tobject);
    begin
      try
        Application.CreateForm(DLLForm, DLLForm);    DLLForm.ShowModal;
      finally
        DLLForm.Free;
        end;
    end;
    最后写上下面二行
    exports
      Showcalendar;   //导出函数可显示窗体。
      

  3.   

    既然是DLL怎么能引用Forms单元呢?
      

  4.   

    我已经改了一点程序了!但工程文件的代码没有变!为什么现在提示
    '.' excepted but ';' found
    可是我的符号没有错啊?不知道是什么原因请大家帮忙!