谁能帮我把这个C++的头文件转成PASCAL的? 我只有这二百分了..(200分)

  • 主题发起人 主题发起人 SystemError
  • 开始时间 开始时间
S

SystemError

Unregistered / Unconfirmed
GUEST, unregistred user!
#pragma once
#ifndef _I_MultiConvert_H_
#define _I_MultiConvert_H_
#include "../Encoder_/Codec/Codec/I_Codec.h"
#include "../Encoder_/Format/Format/I_Format.h"

#include "Plug/Plug.h" //please run PlugTool.exe once when can't include.
//------------------------------------------------------------------------------------------------------------------
#pragma pack(1)
struct ItemInfo
{
WCHAR FilePath[MAX_PATH];
int64 BeginTime;
int64 EndTime;
int input_type;//DVD or sing

WCHAR OutFilePath[MAX_PATH];

//bool IsGetMediaInfo //MediaFileInfo Info;

//以下是DVD或其它多音频文件的东西
bool skip_menu;
int auido_index[64];
int subtitle_index[64];
};

struct StartConvertPar
{
int video_width;
int video_height;
int total_seconds;
int video_total_frames;
};

enum ConvertStat{
Convert_Succeeded,
Convert_Stop,
Convert_GetMediaInfoFailed,
Convert_InitFailed,
Convert_StartFailed,
Convert_NotVideoFound
};

struct I_MultiConvertEvent
{
virtual void __stdcall GetingMediaInfo(LPCWSTR lpcwFilePath) = 0;
virtual void __stdcall SetPosFailed(LPCWSTR lpcwFilePath) = 0;
virtual void __stdcall StartConvert(LPCWSTR InputFile, LPCWSTR OutputFile, StartConvertPar par) = 0;
virtual void __stdcall ConvertFailed(LPCWSTR InputFile, ConvertStat stat) = 0;
virtual void __stdcall ConvertDone(LPCWSTR InputFile, ConvertStat stat) = 0;
};

struct MultiConvertContext
{
HWND hwnd; //预览窗口事件
int* x; //预览位置
int* y; //预览位置
int VideoCodecType; //视频编码类型 dixv, mpeg, wmv...
int AudioCodecType; //音频编码类型 aac, ac3, mp3...
int SubtitleCodecType; //字幕编码类型 src, sub, ass...
int FormatType; //文件合成类型 mkv, avi, asf, mp4...
bool bMark;
};
#pragma pack()

struct I_MultiConvert : public I_Plug
{
virtual bool __stdcall test() = 0;
virtual bool __stdcall InitEvent(I_MultiConvertEvent* event) = 0;
virtual bool __stdcall AddItem(ItemInfo* info) = 0;
virtual bool __stdcall Init(MultiConvertContext context) = 0;
virtual bool __stdcall Start() = 0;
virtual bool __stdcall Stop() = 0;
virtual bool __stdcall GetProgress(int* pos, int* cur_speed, int* avg_speed) = 0;
virtual bool __stdcall Pause() = 0;
virtual bool __stdcall Contiune() = 0;
virtual void __stdcall Preview(bool show, bool realtime) = 0;
};

#endif

这是一个DLL的头文件..我在DELPHI里想调用它,我应该怎么写呢? 希望某位大哥可以给个例子...期盼中...
 
[:D]翻譯是件辛苦的活。
 
幸好代码不算太多...期盼好人大哥的到来...
 
{#pragma once
#ifndef _I_MultiConvert_H_
#define _I_MultiConvert_H_
#include "../Encoder_/Codec/Codec/I_Codec.h"
#include "../Encoder_/Format/Format/I_Format.h"

#include "Plug/Plug.h" //please run PlugTool.exe once when can't include.
//------------------------------------------------------------------------------------------------------------------
}
unit unit2;

interface

uses SysUtils, Windows;

type

//#pragma pack(1)
{$A1}

(*
struct ItemInfo
{
WCHAR FilePath[MAX_PATH];
int64 BeginTime;
int64 EndTime;
int input_type;//DVD or sing

WCHAR OutFilePath[MAX_PATH];

//bool IsGetMediaInfo //MediaFileInfo Info;

//以下是DVD或其它多音频文件的东西
bool skip_menu;
int auido_index[64];
int subtitle_index[64];
};
*)
PItemInfo = ^ItemInfo;
ItemInfo = record
FilePath: array [0..MAX_PATH-1] of WideChar;
BeginTime: Int64;
EndTime: Int64;
input_type: Integer;
OutFilePath: array [0..MAX_PATH-1] of WideChar;
skip_menu: WordBool;
audio_index: array [0..64-1] of Integer;
subtitle_index: array [0..64-1] of Integer;
end;

(*
struct StartConvertPar
{
int video_width;
int video_height;
int total_seconds;
int video_total_frames;
};
*)

StartConvertPar = record
video_width: Integer;
video_height: Integer;
total_seconds: Integer;
video_total_frames: Integer;
end;

(*
enum ConvertStat{

};
*)
ConvertStat = (Convert_Succeeded, Convert_Stop, Convert_GetMediaInfoFailed,
Convert_InitFailed, Convert_StartFailed, Convert_NotVideoFound);

(*
struct I_MultiConvertEvent
{
virtual void __stdcall GetingMediaInfo(LPCWSTR lpcwFilePath) = 0;
virtual void __stdcall SetPosFailed(LPCWSTR lpcwFilePath) = 0;
virtual void __stdcall StartConvert(LPCWSTR InputFile, LPCWSTR OutputFile, StartConvertPar par) = 0;
virtual void __stdcall ConvertFailed(LPCWSTR InputFile, ConvertStat stat) = 0;
virtual void __stdcall ConvertDone(LPCWSTR InputFile, ConvertStat stat) = 0;
};
*)
TEventGetingMediaInfo = procedure(lpcwFilePath: PWideChar); stdcall;
TEventSetPosFailed = procedure(lpcwFilePath: PWideChar); stdcall;
TEventStartConvert = procedure(InputFile: PWideChar; OutputFile: PWideChar; par: StartConvertPar); stdcall;
TEventConvertFailed = procedure(InputFile: PWideChar; stat: ConvertStat); stdcall;
TEventConvertDone = procedure(InputFile: PWideChar; stat: ConvertStat); stdcall;

PI_MultiConvertEvent = ^I_MultiConvertEvent;
I_MultiConvertEvent = record
GetingMediaInfo: TEventGetingMediaInfo;
SetPosFailed: TEventSetPosFailed;
StartConvert: TEventStartConvert;
ConvertFailed: TEventConvertFailed;
ConvertDone: TEventConvertDone;
end;

(*
struct MultiConvertContext
{
HWND hwnd; //预览窗口事件
int* x; //预览位置
int* y; //预览位置
int VideoCodecType; //视频编码类型 dixv, mpeg, wmv...
int AudioCodecType; //音频编码类型 aac, ac3, mp3...
int SubtitleCodecType; //字幕编码类型 src, sub, ass...
int FormatType; //文件合成类型 mkv, avi, asf, mp4...
bool bMark;
};
*)

MultiConvertContext = record
hwond: DWORD;
x: PInteger;
y: PInteger;
VideoCodecType: Integer;
AudioCodecType: Integer;
SubtitleCodecType: Integer;
FormatType: Integer;
bMark: WordBool;
end;


//#pragma pack()
(*
struct I_MultiConvert : public I_Plug
{
virtual bool __stdcall test() = 0;
virtual bool __stdcall InitEvent(I_MultiConvertEvent* event) = 0;
virtual bool __stdcall AddItem(ItemInfo* info) = 0;
virtual bool __stdcall Init(MultiConvertContext context) = 0;
virtual bool __stdcall Start() = 0;
virtual bool __stdcall Stop() = 0;
virtual bool __stdcall GetProgress(int* pos, int* cur_speed, int* avg_speed) = 0;
virtual bool __stdcall Pause() = 0;
virtual bool __stdcall Contiune() = 0;
virtual void __stdcall Preview(bool show, bool realtime) = 0;
};
*)

TEventtest = function: WordBool; stdcall;
TEventInitEvent = function(event: PI_MultiConvertEvent): WordBool; stdcall;
TEventAddItem = function(info: PItemInfo): WordBool; stdcall;
TEventInit = function(context: MultiConvertContext): WordBool; stdcall;
TEventStart = function: WordBool; stdcall;
TEventStop = function: WordBool; stdcall;
TEventGetProgress = function(pos: PInteger; cur_speed: PInteger; avg_speed: PInteger): WordBool; stdcall;
TEventPause = function: WordBool; stdcall;
TEventContiune = function: WordBool; stdcall;
TEventPreview = function(show: WordBool; realtime: WordBool): WordBool; stdcall;

///I_Plug的定义没有。。。。

I_MultiConvert = record
test: TEventtest;
InitEvent: TEventInitEvent;
AddItem: TEventAddItem;
Init: TEventInit;
Start: TEventStart;
Stop: TEventStop;
GetProgress: TEventGetProgress;
Pause: TEventPause;
Contiune: TEventContiune;
Preview: TEventPreview;
end;

implementation


end.
//#endif
 
没有提供Plug.h,所以I_Plug没有翻译
不一定能够正常,自己根据测试情况修改吧
 
谢谢你...我试了一下能正常编译...

TEventAddItem = function(info: PItemInfo): WordBool; stdcall;
像这样的在DELPHI里是怎样调用呢?
 
后退
顶部