|
From: Ben F. <dr....@gm...> - 2015-06-15 13:00:28
|
Keith Marshall wrote: This is FORTRAN, right? So VBANUM is passed *by reference*, (or so it > was for *all* function and subroutine arguments, when I last wrote any > FORTRAN -- about 15 years ago), yet here... > ...you declare the interface in VBA, with VBANUM passed *by value*, so > at the very least, your TIMES2 function will get garbage for its VBANUM > argument. Yes, this is Fortran. When I use ByRef (or don't specify) in VBA, it comes up with a "Bad DLL calling convention" error. I assumed this meant I had misunderstood something along the way, and so I changed it to ByVal, and it appeared to work (except, you know, the crashing part). Any idea what else I've done wrong? Interestingly, I didn't have this issue with the original Fortran. The only thing I had set as ByVal was a string, which I understand is necessary. The rest were left as is, which I believe leaves them as ByRef. That one crashes too, but it doesn't give me any grief about calling conventions. Thanks for your reply. Ben |