help,关于c->pascal问题(50分)

  • 主题发起人 主题发起人 lxmzm
  • 开始时间 开始时间
L

lxmzm

Unregistered / Unconfirmed
GUEST, unregistred user!

typedef VOID (WINAPI *PINIT)();
typedef VOID (WINAPI *PFREE)();
typedef BOOL (WINAPI *POPEN)(LPCSTR,LPCSTR,WAVE_FORM*,CONV_INFO*);
typedef BOOL (WINAPI *PSTART)();
typedef BOOL (WINAPI *PSTOP)();
typedef int (WINAPI *PSTATE)(int*);

HINSTANCE hVbww = NULL;
PINIT pInit = NULL;
PFREE pFree = NULL;
POPEN pOpen = NULL;
PSTART pStart = NULL;
PSTOP pStop = NULL;
PSTATE pState = NULL;

如何转换为pascal?
 
TYPE VOID (WINAPI *PINIT )();
TYPE VOID (WINAPI *PFREE )();
TYPE BOOL (WINAPI *POPEN )(LPCSTR ,LPCSTR ,WAVE_FORM *,CONV_INFO *);
TYPE BOOL (WINAPI *PSTART )();
TYPE BOOL (WINAPI *PSTOP )();
TYPE Integer (WINAPI *PSTATE )(Integer *);

HINSTANCE hVbww := NULL ;
PINIT pInit := NULL ;
PFREE pFree := NULL ;
POPEN pOpen := NULL ;
PSTART pStart := NULL ;
PSTOP pStop := NULL ;
PSTATE pState := NULL ;
 
后面的NULL有写要改成nil
 
张无忌:
下面是对的吗?
TYPE VOID (WINAPI *PINIT )();
TYPE VOID (WINAPI *PFREE )();
TYPE BOOL (WINAPI *POPEN )(LPCSTR ,LPCSTR ,WAVE_FORM *,CONV_INFO *);
TYPE BOOL (WINAPI *PSTART )();
TYPE BOOL (WINAPI *PSTOP )();
TYPE Integer (WINAPI *PSTATE )(Integer *);
VOID在pascal中有这样的吗?
 
void 不要写,什么也不是。
以下应该是函数或过程原型的定义
winapi 表示 pascal 调用规则,所以可以省略
* 表示指针。
大意如下:
typedef VOID (WINAPI *PINIT)();
type
PINIT=procedure;

typedef VOID (WINAPI *PFREE)();
type
PFREE=procedure;
typedef BOOL (WINAPI *POPEN)(LPCSTR,LPCSTR,WAVE_FORM*,CONV_INFO*);
type
POPEN=function(pchar,pchar,^WAVE_FORM,^CONV_INFO):boolean;
typedef BOOL (WINAPI *PSTART)();
typedef BOOL (WINAPI *PSTOP)();
typedef int (WINAPI *PSTATE)(int*);
type
pstate=function(pInteger):integer;
 
type
TPINIT = procedure;stdcall;
TPOPEN = function(v1,v2:LPCSTR;
v3:^WAVE_FORM;
v4:^CONV_INFO): boolean;
stdcall;
TPSTART = function:boolean;stdcall;
var
pInit: TPINIT;
pInit := nil;
其余类推。
 
多人接受答案了。
 
后退
顶部