vb封装c++写的标准dll的参数问题
我有一个c++写的dll使用来从pos机读取数据的,现在我想在asp中用,所以想用vb封装成activex.dll共asp掉用.函数原型如下:
函数原型:int GetLog(char *sLogData);
入口参数:无
出口参数:无
返回值 :返回值 = 0 表示函数调用正确,否则表示错误。
int GetLog(char *sLogData);
sLogData : 读取第一条未采集的日志
日志的格式: 每条记录长度为48字节,具体格式说明如下:
0002002002-03-2007:55:04000102999900000100000852
000200 2002-03-20 07:55:04 0001 029999000001 00 000852
如果sLogData[0] ... sLogData[5] = “999999” 表示Pos机没有日志
vb中应该如何声明该函数?
望各位高手给与指点!!谢谢了!!
问题点数:20、回复次数:6Top
1 楼supergreenbean(超级绿豆(MSMVP - VB) - 升级归来~)回复于 2006-03-15 18:55:17 得分 0
declare function GetLog lib "xx.dll" (byval sLogData as string) as long
dim s as string*48
dim r as long
r=GetLog(s)
if left(s,6)="999999" then
'没有日志
else
'有日志
end ifTop
2 楼foxwangshuohan(乐此不疲)回复于 2006-03-16 09:27:25 得分 0
我测试了一下,如果有日志的话,却返不回值。望给予执教!谢谢!!
Top
3 楼supergreenbean(超级绿豆(MSMVP - VB) - 升级归来~)回复于 2006-03-16 20:20:48 得分 20
你确定 sLogData 是48字节长?对于函数GetLog的其他语言的调用例子你有么Top
4 楼51365133(渊海)回复于 2006-03-16 22:35:17 得分 0
你把C++的调用发上来看看先Top
5 楼goodloop(小志)回复于 2006-03-17 13:22:35 得分 0
MARK 以后我也会用到Top
6 楼foxwangshuohan(乐此不疲)回复于 2006-03-17 15:15:06 得分 0
问题已经解决!!谢谢!!
还有个问题请教!
Function GetLog(cardid As Byte, carddate As Byte, cashmode As Byte, cashmoney As Byte, cashtype As Byte, cashtime As Byte) As Long
在asp中如何调用!!
Top




