山
山顶瀑布
Unregistered / Unconfirmed
GUEST, unregistred user!
我有一dll,其用VB 调用的声明如下:
Type param_byname_data
point_name As String
param_name As String
param_offset As Long
padding1 As Long 'for byte alignment between VB and C
param_value As Variant
param_type As Integer
padding2 As Integer 'for byte alignment between VB and C
status As Long
End Type
Public Declare Function rhsc_param_value_put_bynames Lib "hscnetapi.dll" _
Alias "rhsc_param_value_put_bynames_vb" _
(ByVal Server As String, ByVal num_requests As Long, _
param_byname_data_array() As param_byname_data) As Long
VC 的调用声明如下:
typedef struct _PARAM_BYNAME_DATA
{
n_char *szPntName
/* (in) point name */
n_char *szPrmName
/* (in) parameter name */
n_long nPrmOffset
/* (in) parameter offset */
PARvalue *pupvValue
/* (in/out) parameter value union */
n_ushort nType
/* (in/out) value type */
n_long fStatus
/* (out) status of each value access */
} PARAM_BYNAME_DATA;
EXTERN_C int __loadds CALLBACK rhsc_param_value_put_bynames
_DECLARE((char *, int, PARAM_BYNAME_DATA *));
但我用D6 调用却报参数错误,我调用的声明如下:
Type
param_byname_data = record
point_name : PChar
param_name : PChar
param_offset : LongInt
padding1 : LongInt
//for byte alignment between VB and C
param_value : Variant;
param_type : word;
padding2 : Integer
//for byte alignment between VB and C
status : LongInt
End
{param_byname_data}
function rhsc_param_value_put_bynames(Server : PChar
num_requests : Integer;
numb_prm:array of param_byname_data) : LongInt
cdecl;
external 'hscnetapi.dll' name 'rhsc_param_value_put_bynames_vb';
望各位高手给与解答
Type param_byname_data
point_name As String
param_name As String
param_offset As Long
padding1 As Long 'for byte alignment between VB and C
param_value As Variant
param_type As Integer
padding2 As Integer 'for byte alignment between VB and C
status As Long
End Type
Public Declare Function rhsc_param_value_put_bynames Lib "hscnetapi.dll" _
Alias "rhsc_param_value_put_bynames_vb" _
(ByVal Server As String, ByVal num_requests As Long, _
param_byname_data_array() As param_byname_data) As Long
VC 的调用声明如下:
typedef struct _PARAM_BYNAME_DATA
{
n_char *szPntName
/* (in) point name */
n_char *szPrmName
/* (in) parameter name */
n_long nPrmOffset
/* (in) parameter offset */
PARvalue *pupvValue
/* (in/out) parameter value union */
n_ushort nType
/* (in/out) value type */
n_long fStatus
/* (out) status of each value access */
} PARAM_BYNAME_DATA;
EXTERN_C int __loadds CALLBACK rhsc_param_value_put_bynames
_DECLARE((char *, int, PARAM_BYNAME_DATA *));
但我用D6 调用却报参数错误,我调用的声明如下:
Type
param_byname_data = record
point_name : PChar
param_name : PChar
param_offset : LongInt
padding1 : LongInt
//for byte alignment between VB and C
param_value : Variant;
param_type : word;
padding2 : Integer
//for byte alignment between VB and C
status : LongInt
End
{param_byname_data}
function rhsc_param_value_put_bynames(Server : PChar
num_requests : Integer;
numb_prm:array of param_byname_data) : LongInt
cdecl;
external 'hscnetapi.dll' name 'rhsc_param_value_put_bynames_vb';
望各位高手给与解答