We have alegacy software product that runs in 32-bit mode on IA32 and x64 systems. The32-bit VB.NET routine calls a 32-bit Fortran DLL. No problems.
We want to move to full 64 bit programming.We have experience compiling x64 applications written entirely in Fortran and runningon x64 systems and have no issues to report. The 64-bit VB.NET program is to call a 64-bit Fortran DLL. Right away there was a problem. The VB.NET passes arrays of data but the DLL does not interpret the data correctly. We have simplified the problem to a sample. The Fortran DLL code is attached.
The data passed is an integer array and the upper dimension of the array. In this sample, the array storesthe numbers0 through 6, and the dimension is passed as an integer varaible, 6. The integer value 6 is passed okay. The elements of the array are not. We tested several KINDs of integers. The problem appears for all types. The sample uses 32 bit integers in VB.NET and Fortran. However, the VB.NET caller is 64 bit and the DLL is 64-bit. Type matching is correct between VB.NET and Fortran.
integer variable, upper limit of array simension: 6
The upper dimension appears at entry 1 & 2, there is a zero at 0 entry, and the rest appears to be random data, except for the 6th, which is zero.
Premier support are stumped for now, because of the load of the 11.0 release, and asked me to check this forum. Someone out there must know something obvious that we missed. For your further information, the identical code in VB.NET and Fortran, if set for 32-bit applications, runs as expected and outputs
My colleaugue tells me that the VB.NET caller passes an array of Int32s and was written and compiled with MS VS 2008 & .NET Framework v3.5.
Thanks in advance for any help,