Re: Run-time check #4 from VC in VS2005
- From: "William DePalo [MVP VC++ ]" <willd.no.spam@xxxxxxxx>
- Date: Mon, 12 Dec 2005 21:15:37 -0500
"Dave Moran" <dmoran@xxxxxxxxxxxxx> wrote in message
news:C45F7769-7248-4F8C-BD3D-69F325193654@xxxxxxxxxxxxxxxx
> I'm trying to build an argument list to dynamically call Fortran
> subroutines
> in legacy DLLs from VS2005. I use _alloca to build an array of pointers on
> the stack, to allow the data to be passed by reference. Having created the
> references on the stack, I use inline assembler to call the actual
> subroutine. When I try to exit my calling function I get an RTC #4. The
> guard
> look to be intact, but something is obviously very wrong because the
> program
> crashes shortly afterwards in my c# code.
> ...
> // func is obtained through LoadLibrary and GetProcAddress
> __asm
> {
> call func
> }
>
> // Bang...
Nine times out of ten the error results from a mismatch in calling
conventions. You don't show that code.
How do you define your function pointer? Show that and the Fortran
declaration as well. Do you know if Fortran uses the "standard" calling
convention where the callee pops the arguments off the stack?
Regards,
Will
.
- Prev by Date: Re: how to transfer a DWORD from a function?
- Next by Date: Re: Programmer defined data
- Previous by thread: Re: Why won't this compile
- Next by thread: Re: Run-time check #4 from VC in VS2005
- Index(es):
Relevant Pages
|