procedure DisconnectRoom(const UserName: WideString; RoomID: Integer); safecall; //客户退出指定房间 function TestClearBufferTag(RoomID: Integer): Integer; safecall; //客户测试指定房间的缓冲区的清空与否状况 end; 再来看看接口的实现类TChatManager部分: type TChatManager = class(TAutoObject, IChatManager) protected function ReadFrom(sourceid: Integer): IStrings; safecall; //在这里我们使用Delphi扩展的复杂类型TStings,为了让COM支持这种 //类型,delphi提供了IStrings接口 procedure SpeakTo(const content: WideString; destid: Integer); safecall; function ReadReady(id: Integer): Byte; safecall; //用来提供给客户端查询指定的房间是否可读,既指定房间缓冲区是否为空 procedure ConnectRoom(const UserName: WideString; RoomID: Integer); safecall; procedure DisconnectRoom(const UserName: WideString; RoomID: Integer); safecall; function TestClearBufferTag(RoomID: Integer): Integer; safecall; end; 实现部分: function TChatManager.ReadFrom(sourceid: Integer): IStrings; var |
正在阅读:开发基于DCOM的局域网聊天室(一)开发基于DCOM的局域网聊天室(一)
2004-02-14 09:34
出处:CSDN
责任编辑:linjixiong
键盘也能翻页,试试“← →”键