100分求VC++调用delphi's dll的问题(100分)

  • 主题发起人 hnlg81004
  • 开始时间
H

hnlg81004

Unregistered / Unconfirmed
GUEST, unregistred user!
这是delphi的代码:
type
TTest=packed record // 局部结构表示一个时间点
TimeHour: Integer;
// 小时[0..23]
TimeMinute: Integer;
// 分钟[0..59]
end;
PTests=^TTests;
TTests=packed record // 门禁机时段结构
StartTime: TTest;
// 时段的开始时间
EndTime: TTest;
// 时段的结束时间
Right: Integer;
// 本时段的权限,依不同功能而不同
end;

function Test(hPort: THandle;
Fun: Byte;
ts: array of TTests;Count:Integer;
week: Byte=0): Boolean;stdcall;
这是VC++的代码:
struct TTest
{
int TimeHour;
// 小时[0..23]
int TimeMinute;
// 分钟[0..59]
};
struct TTests
{
TTest StartTime;
// 时段的开始时间
TTest EndTime;
// 时段的结束时间
int Right;
};
typedef BOOL (PASCAL *ECTests)(HANDLE hPort, byte Fun, TTests *ts,int Count, byte week=0);
调用后出现:the value of ESP was not properly saved across a function call....该如何解决。
 
用动态数组做参数交换是永远不好处理的, 想其他办法吧...
 
现在如果必须这么做,就没有解决的办法了吗?用其它办法是可以解决,而且已经有解决办法了,但是那样不是我们想要的。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
812
import
I
I
回复
0
查看
817
import
I
I
回复
0
查看
390
import
I
顶部