MediaInfo.DLL
Pascal スクリプトを使用して JPEG 画像と MP4 ビデオ ファイルの情報を取得するために 2 日以上試みています。
しかし、私はエラーが発生し続けます
ランタイム エラー (6:366) - アドレス 0042FD23 でのアクセス違反。アドレス 8065241E の読み取り。
エラーは主に (6:366) を指しています。
を使用してメディア情報を取得しようとしたときに、この例外の原因となっている問題がわかりませんMediaInfo.DLL.
スクリプトに追加したコード:
[Files]
Source: Lamborghini_Aventador.jpg; DestDir: {tmp}; Flags: dontcopy
Source: MediaInfo.dll; DestDir: {tmp}; Flags: dontcopy
[Code]
#ifdef UNICODE
type
PWideChar = WideString;
#endif
const
StreamKind_Image = 5;
InfoKind_Text = 1;
function MediaInfo_New: Cardinal;
external 'MediaInfo_New@{tmp}\MediaInfo.dll stdcall delayload';
function MediaInfo_Open(Handle: Cardinal; File__: PWideChar): Boolean;
external 'MediaInfo_Open@{tmp}\MediaInfo.dll stdcall delayload';
function MediaInfo_Get(Handle: Cardinal; StreamKind: Integer; StreamNumber: Integer; Parameter: PWideChar; KindOfInfo: Integer; KindOfSearch: Integer): PWideChar;
external 'MediaInfo_Get@{tmp}\MediaInfo.dll stdcall delayload';
procedure RetrieveImageInformation;
var
IHandle: Cardinal;
Width: PWideChar;
begin
ExtractTemporaryFile('Lamborghini_Aventador.jpg');
ExtractTemporaryFile('MediaInfo.dll');
IHandle := MediaInfo_New();
MediaInfo_Open(IHandle, PWideChar(ExpandConstant('{tmp}\Lamborghini_Aventador.jpg')));
Width := MediaInfo_Get(IHandle, StreamKind_Image, 0, 'Width', InfoKind_Text, 0);
Log('Width of the JPEG Image: ' + PWideChar(Width) + '.');
end;
例外が生成されている行は次のとおりです。
Width := MediaInfo_Get(IHandle, StreamKind_Image, 0, 'Width', InfoKind_Text, 0);
コンパイラの出力は次のようになると予想していましたWidth of the JPEG Image: 1920.
最新バージョンの Unicode Inno Setup Compiler (5.5.9 - U) を使用しています
あなたの重要な助けを前もって感謝します。