我这里有个c的函数
__declspec(dllexport) void WINAPI jiami(char *buf, long buflen)
{
char charbefore,charafter;
int shiwei[16]={12,1,13,0,2,4,6,3,7,10,8,11,15,9,5,14};
int gewei[16] ={13,6,4,1,11,9,7,5,3,12,14,2,15,8,0,10};
int i;
int highbyte,lowbyte;
for(i=0;i<buflen;i++)
{
charbefore=buf[i];
highbyte=(charbefore & 0xF0) /16;
lowbyte=charbefore & 0x0F;
charafter=shiwei[highbyte] * 16 + gewei[lowbyte];
buf[i]=charafter; }
return ;
}
现在我想把他转换成delphi的,但我是新人对其中不同类型的计算还不是很清楚。
求高手能帮我看看这个如何转换。3x!!!
__declspec(dllexport) void WINAPI jiami(char *buf, long buflen)
{
char charbefore,charafter;
int shiwei[16]={12,1,13,0,2,4,6,3,7,10,8,11,15,9,5,14};
int gewei[16] ={13,6,4,1,11,9,7,5,3,12,14,2,15,8,0,10};
int i;
int highbyte,lowbyte;
for(i=0;i<buflen;i++)
{
charbefore=buf[i];
highbyte=(charbefore & 0xF0) /16;
lowbyte=charbefore & 0x0F;
charafter=shiwei[highbyte] * 16 + gewei[lowbyte];
buf[i]=charafter; }
return ;
}
现在我想把他转换成delphi的,但我是新人对其中不同类型的计算还不是很清楚。
求高手能帮我看看这个如何转换。3x!!!
解决方案 »
- Delphi图片显示问题
- 出现“ambiguous column name ‘var'这个问题应如何解决?
- fastreport做复合报表时,同时有纵向和横向的页面,预览时有时横向的页面也变成了纵向,郁闷中...请帮帮忙!!!!
- 快来帮我啊----TDBComboBox怎样填充下拉条??
- 来捡分吧!
- 有经验者救救我,ado+dbgrid控件的问题?
- 请帮我看看有什么错????????
- 实现用一个ADOQuery查完A表然后查B表接着查C表的简单问题
- 如何:在DELPHI能否怎样编写定时开机程序,怎么做,知道者帮忙,必有重谢
- 大家帮忙该delphi的错
- 菜鸟问题送分
- 如何获得网页上的验证码图片上的数字?
var
charbefore,charafter:char;
shiwei:array[0..15] of integer=[12,1,....];//十位
gewei:array[0..15] of integer=[13,6....];//个位
i,highbyte,lowbyte:integer;
tmpstr:String;