调用VC写的DLL出现问题
xhd80 2008-09-04 10:52:29 VC写的DLL中有如下三个内容::
3. Search IC:
int WINAPI Inventory(uc8* buf,us8 &count,us8 timeout);
uc8 buf[128];
us8 cnt = 5;
ret = _Inventory(buf,cnt,500);//Timeout500
The cnt is IC Count while return OK, ID length is 8 and ID has been save to buf
4. Read Simply Block:
int WINAPI ReadSingleBlock(uc8* buf,byte block,us8 opmode);
Description:
Block: block index of IC //0~63
Opmode: mode of operate
Use:
if(mode == AddressMode)
{
uc8 dat[ID_LENGTH];
..//ID length is 8
ret = _ReadSingleBlock(dat,0,mode);
if(ret==RET_OK)
{
Recive block data to dat, the data length is SINGLE_BLOCK_SIZE//
}
}
else
{
uc8 dat[SINGLE_BLOCK_SIZE];
memset(dat,0,SINGLE_BLOCK_SIZE);
ret = _ReadSingleBlock(dat,cmbBlock->ItemIndex,mode);
if(ret==RET_OK)
{
//other
}
}
5. Write simply Block:
int WINAPI WriteSingleBlock(uc8* id,uc8* buf,byte block,us8 opmode);
Description:
Id: IC 的ID
Block: block index of IC //0~63
Opmode: mode of operate
Use:
us8 mode = … ;
if(mode == AddressMode)
{
uc8 id[ID_LENGTH];
uc8 dat[ID_LENGTH];
memset(id,0,ID_LENGTH );
memset(dat,0,SINGLE_BLOCK_SIZE);
ret = _WriteSingleBlock(id,dat,block,mode); //need ID
}
else
{
uc8 dat[SINGLE_BLOCK_SIZE];
memset(dat,0,SINGLE_BLOCK_SIZE);
HexToBin2(edtData->Text,dat);
ret = _WriteSingleBlock(NULL,dat, block,mode); // needlessness ID
}
请问在delphi中怎么调用啊???????????