单元引用问题

天云舞 2010-09-30 08:35:52
第一个单元,是一个带窗体的单元
unit UMain;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
...
implementation

{$R *.dfm}
uses
ULobbyServerGen;

procedure TFMain.FormCreate(Sender: TObject);
var
hr:HRESULT;
begin
hr:=hrInitializeDirectPlay();//***********************
//if failed(hr) then
end;

单元2
unit Unit2;

interface
uses
Windows,DirectPlay8,ActiveX,Dialogs, StdCtrls, SyncObjs,Winsock,SysUtils, Variants;
...
implementation

uses
UMain;
//创建用户
function hrCreatePlayer(pvUserContext: Pointer; pMsgBuffer: Pointer): HRESULT;stdcall;
begin
end;

单元2引用单元1,因为单元2需要在单元1的窗体上输出数据;
单元1引用单元2,因为单元1需要用到单元2的函数;
但是单元1 hr:=hrInitializeDirectPlay();//***********************这句话,系统在编译的时候提示没有声明,这是怎么回事,应该如何解决?
...全文
50 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
Mit1208 2010-09-30
  • 打赏
  • 举报
回复
恭喜,接下分~
sg_knight 2010-09-30
  • 打赏
  • 举报
回复
来晚了。
ecjtu5208 2010-09-30
  • 打赏
  • 举报
回复
恭喜,接分。
天云舞 2010-09-30
  • 打赏
  • 举报
回复
该问题已经解决!

16,748

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 语言基础/算法/系统设计
社区管理员
  • 语言基础/算法/系统设计社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧