函数是:
extern "C" __declspec( dllexport ) BOOL __stdcall FetchDetail( ProjectDetail &pd )
VBA中是:
Declare Function FetchDetail Lib "petlsql.dll" Alias "_FetchDetail@4" (ByRef pd As ProjectDetail) As Long
struct ProjectDetail
{
char material_serial[10];
char material_name[50];
char provider_serial[10];
char provider_name[50];
int beforehand;
int distill;
int credit;
int lc;
int currency;
int goods_production_period;
char goods_production_time[20];
int goods_installation_period;
char goods_installation_time[20];
int payment_production_period;
char payment_production_time[20];
float payment_production_value;
int payment_installation_period;
char payment_installation_time[20];
float payment_installation_value;
};vba中定义的结构是:
Type ProjectDetail
material_serial As String * 10
material_name As String * 50
provider_serial As String * 10
provider_name As String * 50
beforehand As Integer
distill As Integer
credit As Integer
lc As Integer
currency As Integer
goods_production_period As Integer
goods_production_time As String * 20
goods_installation_period As Integer
goods_installation_time As String * 20
payment_production_period As Integer
payment_production_time As String * 20
payment_production_value As Single
payment_installation_period As Integer
payment_installation_time As String * 20
payment_installation_value As Single
End Type调用以后vc函数传出的数据和vba中得到的数据不一致,请问是不是我vba里的数据结构定义的问题,谢谢
extern "C" __declspec( dllexport ) BOOL __stdcall FetchDetail( ProjectDetail &pd )
VBA中是:
Declare Function FetchDetail Lib "petlsql.dll" Alias "_FetchDetail@4" (ByRef pd As ProjectDetail) As Long
struct ProjectDetail
{
char material_serial[10];
char material_name[50];
char provider_serial[10];
char provider_name[50];
int beforehand;
int distill;
int credit;
int lc;
int currency;
int goods_production_period;
char goods_production_time[20];
int goods_installation_period;
char goods_installation_time[20];
int payment_production_period;
char payment_production_time[20];
float payment_production_value;
int payment_installation_period;
char payment_installation_time[20];
float payment_installation_value;
};vba中定义的结构是:
Type ProjectDetail
material_serial As String * 10
material_name As String * 50
provider_serial As String * 10
provider_name As String * 50
beforehand As Integer
distill As Integer
credit As Integer
lc As Integer
currency As Integer
goods_production_period As Integer
goods_production_time As String * 20
goods_installation_period As Integer
goods_installation_time As String * 20
payment_production_period As Integer
payment_production_time As String * 20
payment_production_value As Single
payment_installation_period As Integer
payment_installation_time As String * 20
payment_installation_value As Single
End Type调用以后vc函数传出的数据和vba中得到的数据不一致,请问是不是我vba里的数据结构定义的问题,谢谢
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货