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

Mixed Mode VB calls F90, Access Violation

Richard_M_4
Beginner
312 Views

I have a program that runs fine as an executable.  I made a DLL out of it and called it from VB.  That all works fine until it comes to the part of the F90 code where there's an array of Types.  As soon as it references a member of the type MB(I)%Time, it throws an access violation.  I tried declaring the array of Types as both Static and Dynamic, it still ACCVIO's out.  I wonder if this is something in the security model?

0 Kudos
2 Replies
Steven_L_Intel1
Employee
312 Views

Summary descriptions of code are not useful in diagnosing problems. There are many issues relating to passing arguments between VB and Fortran. If you'll show us the VB code and the Fortran code we may be able to help. (And by code I don't mean snippets - Ideally a minimal example that shows the problem.)

0 Kudos
Richard_M_4
Beginner
312 Views

Thanks for the reply.  It looks like the problem was declaring the Parameter I was passing (a single integer) from VB to F90. I had declared it incorrectly in the VB.  I used

<DllImport("ExtranDB.dll")>Public Shared Sub ExtranDB(ByVal I as Integer)

But after looking harder at it, every time it access the parameter it ACCVIO'd.  Worked great after

<DllImport("ExtranDB.dll")>Public Shared Sub ExtranDB(ByRef I as Integer)

So you can consider this closed.

 

0 Kudos
Reply