在CBuilder4中,如何把已经做好的Form塞入dll中,通过dll使这个form能被exe调用。
在CBuilder4中,如何把已经做好的Form塞入dll中,通过dll使这个form能被exe调用。
我按书上说的先用CBuiler自己带的DLL向导生成一个DLL的框架,
然后New一个Form出来。
改Form的头文件如下:
#ifndef Unit1H
#define Unit1H
#ifdef _DLL_ //1我手工加
#define DLL_EXP _declspec(dllexport) //2我手工加
#else //3我手工加
#define DLL_EXP _declspec(dllimport) //4我手工加
#endif //5我手工加
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
//---------------------------------------------------------------------------
class DLL_EXP TForm1 : public TForm //6我手工在class 与 TForm1 这间加入DLL_EXP
{
__published: // IDE-managed Components
TEdit *Edit1;
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
可是竟然存不了盘!并给出以下提示:
Error in module Unit1:Declaration of class TForm1 is missing
or incorrect.
unit1.cpp文件我没有动。
请问怎么办?