Guest_imported
New member
- Jan 1, 1970
- 0
So.. i need to send from VB6 a STRUCTURED ARRAY into a VC++ DLL!!
i just prepared this 2 file:
VB6 EXE FILE
------------
public type secondarr
value1 as long
value2 as long
end type
publit type strarr
superarr() as secondarr
value3 as long
end type
Private Declare Function tryout Lib "<myc++lib>" (Byref PArr as strarr) as long
public sub PassArray()
dim myarr(0) as starr
redim myarr(0).superarr(0)
myarr(0).value3=3
myarr(0).superarr(0).value1=1
myarr(0).superarr(0).value2=2
msgbox tryout(myarr(0))
end sub
VC
----
[this is a Dynamic-DLL]
[....]
//only function and struct here
[in h]
struct secondarr
{
int value1;
int value2;
};
struct strarr
{
secondarr* superarr;
int value3;
};
[in cpp]
int tryout(strarr * myarr)
{
return strarr[0].superarr[0].value1; // <-- don't work
return stratt[0].value3; // <-- work correctly...
};
...................
so where is the problem????
i need to read a substructired array but... in this case i only operate on first level of array....
any one has other solution???????
thx....
i just prepared this 2 file:
VB6 EXE FILE
------------
public type secondarr
value1 as long
value2 as long
end type
publit type strarr
superarr() as secondarr
value3 as long
end type
Private Declare Function tryout Lib "<myc++lib>" (Byref PArr as strarr) as long
public sub PassArray()
dim myarr(0) as starr
redim myarr(0).superarr(0)
myarr(0).value3=3
myarr(0).superarr(0).value1=1
myarr(0).superarr(0).value2=2
msgbox tryout(myarr(0))
end sub
VC
----
[this is a Dynamic-DLL]
[....]
//only function and struct here
[in h]
struct secondarr
{
int value1;
int value2;
};
struct strarr
{
secondarr* superarr;
int value3;
};
[in cpp]
int tryout(strarr * myarr)
{
return strarr[0].superarr[0].value1; // <-- don't work
return stratt[0].value3; // <-- work correctly...
};
...................
so where is the problem????
i need to read a substructired array but... in this case i only operate on first level of array....
any one has other solution???????
thx....