我即将完成我的Inno安装脚本,但我甚至不能,因为在编译脚本后,我在程序安装过程中选择播放背景视频时出现“无法调用proc”错误。单击“确定”后在出现异常消息框时,视频播放正常并在设置完成后自动关闭,如我所料。 当我选择“视频背景”单选按钮然后单击“安装”时,为什么会出现“无法调用proc”错误?
红线显示第515行。 第515行是:
if DSInitializeVideoFile(ExpandConstant('{tmp}\Video.mp4'), BackgroundForm.Handle, Width, Height, @BackgroundVideoPlay) then
程序()仅在选择以视频作为背景播放视频时,安装页面才会调用PlayMPEGVideo。
我在Pastebin中粘贴了整个脚本,因为需要整个代码来查找导致“无法调用proc”的执行顺序问题................ 链接:http://pastebin.com/MaFNeCTZ
提前致谢。
减少的脚本:
procedure PlayMPEGVideo();
var
Width, Height: Integer;
begin
if VBRadio2.Checked then begin
if FileExists(ExpandConstant('{tmp}\Video.mp4')) then begin
if DSInitializeVideoFile(ExpandConstant('{tmp}\Video.mp4'),BackgroundForm.Handle, Width, Height, @BackgroundVideoPlay) then
begin
BackgroundForm.Width := GetSystemMetrics(0);
BackgroundForm.Height := GetSystemMetrics(1);
DSPlayMediaFile;
WizardForm.BringToFront;
PauseBT.Show;
PlayBT1.hide;
PlayBT.hide;
with WizardForm do begin
WizardForm.NextButton.Caption := 'Install';
end;
end;
end;
end else begin
with WizardForm do begin
if CurPageID=wpInstalling then begin
PauseBT.hide;
CompactCheckBox.Visible := False;
WizardForm.WizardSmallBitmapImage.Show;
WizardForm.Bevel1.Show;
//WizardForm.Caption := ' Installing Grand Theft Auto IV';
with WizardForm do begin
WizardForm.ProgressGauge.show;
end;
end;
end;
end;
end;
如果你找不到可能导致“无法调用proc”错误的错误,那么你可能需要查看给定链接中的整个脚本。
这是:
type
TDirectShowEventProc = procedure(EventCode, Param1, Param2: Integer);
function DSGetLastError(var ErrorText: WideString): HRESULT;
external 'DSGetLastError@files:mediaplayer.dll stdcall';
function DSPlayMediaFile: Boolean;
external 'DSPlayMediaFile@files:mediaplayer.dll stdcall';
function DSStopMediaPlay: Boolean;
external 'DSStopMediaPlay@files:mediaplayer.dll stdcall';
function DSSetVolume(Value: LongInt): Boolean;
external 'DSSetVolume@files:mediaplayer.dll stdcall';
function DSSetBalance(Value: LongInt): Boolean;
external 'DSSetBalance@files:mediaplayer.dll stdcall';
function DSInitializeAudioFile(FileName: WideString; CallbackProc: TDirectShowEventProc): Boolean;
external 'DSInitializeAudioFile@files:mediaplayer.dll stdcall';
function DSInitializeVideoFile(FileName: WideString; WindowHandle: HWND; var Width, Height: Integer; CallbackProc: TDirectShowEventProc): Boolean;
external 'DSInitializeVideoFile@files:mediaplayer.dll stdcall';
现在更新。