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

Mixed Mode VB calls F90, Access Violation

Richard_M_4
Débutant
790 Visites

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 Compliments
2 Réponses
Steven_L_Intel1
Employé
790 Visites

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 Compliments
Richard_M_4
Débutant
790 Visites

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 Compliments
Répondre