B
bluesnow
Unregistered / Unconfirmed
GUEST, unregistred user!
vc中的函数声明如下:
short DllExport
MLAdd_create_device
(
CHAR * o_pIndex,
unsigned char i_nDeviceType
);
vc中的调用如下:
#define M_VIDEOLIVE 0x02
SHORT l_nRep;
CHAR l_nDevice;
l_nRep = MLAdd_create_device(&l_nDevice, M_VIDEOLIVE);
请问:在delphi中该如何声明函数,如何定义函数参数类型,如何调用?
我做了如下声明及调用,但是就是不对,请大侠帮忙,万分感谢!
function MLAdd_create_device( o_pIndexchar;i_nDeviceType:byte):smallint
stdcall
external 'Add.dll';
var
l_nRep:smallint
l_nDeviceChar
begin
try
GetMem(l_nDevice,8);
l_nRep:=MLAdd_create_device(@l_nDevice,M_VIDEOLIVE)
// M_VIDEOLIVE
finally
FreeMem(l_nDevice);
end;
end;
short DllExport
MLAdd_create_device
(
CHAR * o_pIndex,
unsigned char i_nDeviceType
);
vc中的调用如下:
#define M_VIDEOLIVE 0x02
SHORT l_nRep;
CHAR l_nDevice;
l_nRep = MLAdd_create_device(&l_nDevice, M_VIDEOLIVE);
请问:在delphi中该如何声明函数,如何定义函数参数类型,如何调用?
我做了如下声明及调用,但是就是不对,请大侠帮忙,万分感谢!
function MLAdd_create_device( o_pIndexchar;i_nDeviceType:byte):smallint
stdcall
external 'Add.dll';
var
l_nRep:smallint
l_nDeviceChar
begin
try
GetMem(l_nDevice,8);
l_nRep:=MLAdd_create_device(@l_nDevice,M_VIDEOLIVE)
// M_VIDEOLIVE
finally
FreeMem(l_nDevice);
end;
end;