在Dll中直接导出窗体类失败
无理蛇 2013-01-26 05:40:00 在BCB 2007中创建一个Dll, (VCL+多线程), 加入一个窗体,加入__declspec( dllexport),让其输出
#ifndef Unit5H
#define Unit5H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
//---------------------------------------------------------------------------
class __declspec( dllexport) TForm5 : public TForm
{
__published: // IDE-managed Components
private: // User declarations
public: // User declarations
__fastcall TForm5(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm5 *Form5;
//---------------------------------------------------------------------------
#endif
编译都没有问题,但在应用程序调这个Dll时,New一个对象的时候提示地址访问出错.
TForm5 *frmTemp = TForm5(NULL);
同时,输出线程类也是一样,就是一个线程类继承自TThread类,也是一样的错误。
请问各位大虾,是什么问题