Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29274 Discussions

passing UDT array from VB to fortran DLL

vfedeli
Beginner
1,150 Views
I'm not able to pass an array of UDT from a VB program to a subroutine in a DVF dll
the UDT is this :
TYPE PAR_TS
SEQUENCE
REAL(4) B0EI
REAL*4 B0SF
REAL*4 BSC_RAS
REAL*4 BSC_AGGSOL
REAL*4 TAUSC
INTEGER*4 KTIPO
INTEGER*2 IDCLS_EI
INTEGER*2 IDCLS_SF
CHARACTER(len=8) DESCRB
CHARACTER(len=32) DESCR
END TYPE
the problem (I think) are the fixed-length strings
can you help me ? canI find somewhere something about this topic ?
I'm using VB 6.0 (SP3) and Compaq VF 6.1A
thanks
0 Kudos
4 Replies
g_f_thomas
Beginner
1,150 Views
Exchanging strings between VB and CVF can be tricky. It has been discussed many times in the past: search the CVF archives at
http://softwareforums.intel.com/ids/board?board.id=15
Also, take a look at ...DF98SAMPLESMIXLANGVBTYPEARRAYS

Ciao,
Gerry T.
0 Kudos
tmadden
Beginner
1,150 Views
Any suggestions if I want to see that example, but have Intel Fortran?
A similar example for IVF would actually be better.
Thanks
0 Kudos
Steven_L_Intel1
Employee
1,150 Views
I have attached the CVF sample - it should be pretty much the same for IVF.
0 Kudos
gkchang0927
Beginner
1,150 Views
I used the .NET conversion program to convert the above mentioned CVF TypeArrays example, but it doesn't work. Further experiments shows that type arrays with array elements simply won't work.

Using SafeArrayAccessData call appear to work in VB6 but not in VB.NET. It make me wonder VB6 and VB.NET may have very different argument passing convesion.

So far, as I tried out different combinations, there are two situations that work:
(1) a single UDT with array elemenents, or
(2) UDT arrays with scalar elements.

It was done by simply passing the an UDT or UDT arrays ByRef on the VB.NET side and receive the arguments without using SafeArrayAccessData.

Have anybody have any success passing type arrays with array elements between VB.NET and IVF Win32 DLL?

TIA
-George
0 Kudos
Reply