Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
16 Views

Mixed Mode VB calls F90, Access Violation

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
Highlighted
16 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
Highlighted
Beginner
16 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