大家好,我想问下以下这种C++结构应该怎样转换成delphi的结构typedef struct tmPlayControlCfg_t
{
unsigned int dwSize; //本结构大小
unsigned int dwCommand; //控制命令
union
{
tmTimeInfo_t struTime; //文件的开始时间
int iPlayData; //播放参数
int iSpeed; //播放的速度
int iEnableAudio; //音频开关
int iCurrentPosition; //新的播放位置(帧)
unsigned int dwCurrentTime; //新的播放位置(毫秒)
BOOL bForward; //前进单帧
BOOL bClearDisplay; //清空显示 struct
{
unsigned char byAutoCreateIndex; //是否自动生成索引
unsigned char byAutoPlay; //打开后是否自动播放
unsigned char byTemp[2];
char sFileName[128]; //切换到文件名
}file;

struct
{
tmAvIndexEntry_t* pAvIndex; //索引缓冲
int iAvIndexCount; //缓冲中的索引数
int iAvIndexMaxCount; //缓冲的总索引数
}index;

}control;
}tmPlayControlCfg_t;

解决方案 »

  1.   

    type
    tmPlayControlCfg_t = record
    dwSize: cardinal;
    dwCommand: cardinal;
    control: record
    case integer of
    0: (struTime: tmTimeInfo_t;);
    1: (iPlayData: integer;);
    2: (iSpeed: integer;);
    3: (iEnableAudio: integer;);
    4: (iCurrentPosition: integer);
    5: (dwCurrentTime: cardinal);
    6: (bForward: boolean);
    7: (bClearDisplay: boolean);
    8: (file: record
    byAutoCreateIndex: byte;
    byAutoPlay: byte;
    byTemp: array[0..1] of byte;
    sFileName: array[0..128] of char;
    end;);
    9: (index: record
    pAvIndex: ^tmAvIndexEntry_t;
    iAvIndexCount: integer;
    iAvIndexMaxCount: integer;
    end;);
    end;
    end;