简单问题求助~~~~~~~~~~~~~~~

shaojie 2003-09-11 02:28:45
为什么我的程序不能执行呢??错在哪里了??

unit unit1;

interface

uses
windows, messages, mmsystem, classes, graphics, controls, forms, dialogs,
stdctrls;

type
tform1 = class(tform)
soundbtn: tbutton;
procedure soundbtnclick(sender: tobject);
private
{ private declarations }
public
{ public declarations }
end;

var
form1: tform1;

implementation

{$r *.dfm}
{$r my.res}
procedure tform1.soundbtnclick(sender: tobject);
var
findhandle,reshandle:thandle;
resptr:pointer;
begin
findhandle:=findresource(hinstance,’mymusic’,’wave’);
if findhandle <> 0
then begin
reshandle:=loadresource(hinstance,findhandle);
if reshandle <> 0
then begin
resptr:=lockresource(reshandle);
if resptr <> nil
then sndplaysound(pchar(resptr),snd_async or snd_async);
unlockresource(reshandle);
end;
freeresource(findhandle);
end;

end;

‘底下的提示是这么说的:

[error] unit1.pas(47): 说明盼望但是 文件结束发现
[fatal error] project1.dpr(5): 不能编译使用单元 ’unit1.pas’

help~~~~~~~~~~help~~~~~~~~~~~




另外请问哪里有DELPHI5的教程下载,请给出地址,谢谢~~~~~~~~~~~~~
...全文
37 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
shaojie 2003-09-11
  • 打赏
  • 举报
回复
不好意思,我的分定少了,就不平均分了,前4人给分,其他人不好意思了~~~~~~~~~~~
Dephiuser 2003-09-11
  • 打赏
  • 举报
回复
缺一个end;
shaojie 2003-09-11
  • 打赏
  • 举报
回复
hongqi162(失踪的月亮) ,你给的页面怎么没有下载的链接呢??
shaojie 2003-09-11
  • 打赏
  • 举报
回复
可以了,可是为什么我加入RES资源文件的WAV文件声音没有呢??
IORILI 2003-09-11
  • 打赏
  • 举报
回复
最后少了个end.
hongqi162 2003-09-11
  • 打赏
  • 举报
回复
http://www.51delphi.com/delphi/book?type=delphi
dulei115 2003-09-11
  • 打赏
  • 举报
回复
写程序要注意代码的缩进
上海老李 2003-09-11
  • 打赏
  • 举报
回复
你要查一下你的代码
unit unit1;

interface

uses
implementation

{$r *.dfm}
{$r my.res}
//要保证在这的begin...end 是成对的
end.//这里是结束符不是分号
seashoreboy 2003-09-11
  • 打赏
  • 举报
回复
好像没有
end.

5,379

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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