BCB6 DLL 封装 TClientSocket 或着给个演示程序程序也行
在DLL 中自己定义一个类
class SocketTemp:public TClientSocket
{
private:
public:
//TClientSocket *ClientSocket;
void __fastcall ClientRead(TObject *Sender,TCustomWinSocket *Socket);
};
SocketTemp *Client1;---定义类变量
Client1= new LedSocket(NULL) ;---编译时出错提示:Compiler could not generate default constructor for class "SocketTemp"
如何解决?谢谢!
[解决办法]
如果你自己没啥初始化的东西,写个空的就行了
SocketTemp::SocketTemp() {}
[解决办法]
TClientStocket的头文件包含进来
[解决办法]
class SocketTemp:public TClientSocket{ private: public: //TClientSocket *ClientSocket; __fastcall SocketTemp(TComponent* Owner):TClientSocket(Owner) {} `__fastcall ~SocketTemp() {} void __fastcall ClientRead(TObject *Sender,TCustomWinSocket *Socket);};