VC下的变量和delphi下的是怎么对应的呀?
由于有一些硬件卡上提供的API是C写的,现在有一个这些函数原型的C语音的头文件
现在我们在Delphi下需要使用这些函数,需在delphi下重新定义,不知这些类型是怎么对照的
32为的平台C delphilong ?
int Integer
char char
bool boolean
char * ?
? String
? Pchar
word ?
DWord ?还有, API中有一个需要用到函数指针,即使用回调函数C下是这么用的int WINAPI DJH323_SetCallEventHandler( DWORD dwEventMask, long (WINAPI * hdlr)(DWORD dwEvent, int iChID));
long WINAPI IPCallBackProc(DWORD dwEvent, int ch)
{
......
}
调用时: DJH323_SetCallEventHandler(H323_EV_ALL, IPCallBackProc);我在delphi下这么定义:
type TIPCallBackProc= function(dwEvent: DWORD; iChID: Integer ):Integer;stdcall ;
function DJH323_SetCallEventHandler( dwEventMask: DWORD; IPCallBackProc: TIPCallBackProc):Integer; stdcall; far external 'djH323.dll';
函数实体
function IPCallBackProc( dwEvent: DWORD; IPch:Integer ):Integer;stdcall ;
begin
end;
调用时: DJH323_SetCallEventHandler(H323_EV_ALL, @IPCallBackProc);可不知道为什么总是出错,好象是堆栈不一致,提示信息:
Debug Error!
Program : D:\....\project1.exe
Module:
file: i386\chkesp.c
line: 42The value of esp was not properly save across a function call. this is usually of calling a function declared with one calling convention with a function pointer declared with a different calling convention.这里C语音下的 long (WINAPI * hdlr) 在delphi下怎么处理呀?
小弟在此先谢过了
//bow
由于有一些硬件卡上提供的API是C写的,现在有一个这些函数原型的C语音的头文件
现在我们在Delphi下需要使用这些函数,需在delphi下重新定义,不知这些类型是怎么对照的
32为的平台C delphilong ?
int Integer
char char
bool boolean
char * ?
? String
? Pchar
word ?
DWord ?还有, API中有一个需要用到函数指针,即使用回调函数C下是这么用的int WINAPI DJH323_SetCallEventHandler( DWORD dwEventMask, long (WINAPI * hdlr)(DWORD dwEvent, int iChID));
long WINAPI IPCallBackProc(DWORD dwEvent, int ch)
{
......
}
调用时: DJH323_SetCallEventHandler(H323_EV_ALL, IPCallBackProc);我在delphi下这么定义:
type TIPCallBackProc= function(dwEvent: DWORD; iChID: Integer ):Integer;stdcall ;
function DJH323_SetCallEventHandler( dwEventMask: DWORD; IPCallBackProc: TIPCallBackProc):Integer; stdcall; far external 'djH323.dll';
函数实体
function IPCallBackProc( dwEvent: DWORD; IPch:Integer ):Integer;stdcall ;
begin
end;
调用时: DJH323_SetCallEventHandler(H323_EV_ALL, @IPCallBackProc);可不知道为什么总是出错,好象是堆栈不一致,提示信息:
Debug Error!
Program : D:\....\project1.exe
Module:
file: i386\chkesp.c
line: 42The value of esp was not properly save across a function call. this is usually of calling a function declared with one calling convention with a function pointer declared with a different calling convention.这里C语音下的 long (WINAPI * hdlr) 在delphi下怎么处理呀?
小弟在此先谢过了
//bow
解决方案 »
- 哪里有 delphi+sql 2000 网络信息管理系统方面的资料
- 在delphi中如何修改一个注册表不中KEY 中的一个参数值 ,以及增加与册除KEY 的参数,要求不要叫删除了KYE 后新建
- 如何把jpg图形设为墙纸
- ★★★★升星放分,各位XDJM棒场呀,随便UP★★★★
- 两个数据库问题,急求解答,每题各100分,在线等待...... 先谢谢各位大侠
- 大家好!请问为什么我自制的组件在DELPHI6的控制面板中看不到呀??
- delphi调用vc开发的dll的问题
- 100分求教:delphi4编程技术内幕和delphi5、6中文版电子书(网址)
- 关于delphi中窗口从绘的消息
- 求助,Delphi中的Unit3和Unit2用到Unit1,unit3用Unit2为什么出错?
- !!!!!!!有关回调函数,急,在线等!!!!!!!!
- 数据导入问题!!!!急
C delphilong ?Longint
int Integer
char char
bool boolean
char * ?PChar
?<NULL> String
?char * Pchar
word ?Word
DWord ?DWORD
这是你昨天贴的帖子,我已经测试过你的代码,在我的机器上没出现什么异常~~
确定是否还有初始化没完成~~
char * PChar
No String
Char * Pchar
word Word
DWord Longword 第二个问题不太明白
type TIPCallBackProc= function(dwEvent: DWORD; iChID: Integer ):LongInt;stdcall ;
吧
在我的机器上:
首先要 type TIPCallBackProc= function(dwEvent: DWORD; iChID: Integer ): LongInt; stdcall ;
第二 function DJH323_SetCallEventHandler( dwEventMask: DWORD; IPCallBackProc: TIPCallBackProc):Integer; cdecl; far external 'djH323.dll';