Re: Run-time check #4 from VC in VS2005
- From: "Carl Daniel [VC++ MVP]" <cpdaniel_remove_this_and_nospam@xxxxxxxxxxxxxxx>
- Date: Tue, 13 Dec 2005 06:32:02 -0800
Dave Moran wrote:
> Hi Will
>
> This is my function pointer declaration:
>
> typedef void ( __stdcall * lpF77Func) (void);
>
> This is my Fortran subroutine:
>
> SUBROUTINE BLEVCF (IGAS)
> CDEC$ ATTRIBUTES DLLEXPORT :: BLEVCF
> INTEGER IGAS
> ...
> END
>
> I wasn't sure which order things came off the stack, but I figured
> that with one item on the stack this wouldn't be an issue.
I'm pretty sure that's declaring a __cdecl function in fortran, not
__stdcall as you're attempting.
Try changing your typedef to __cdecl and add code to your asm trampoline to
pop the arguments off the stack after the functions returns.
-cd
.
- References:
- Re: Run-time check #4 from VC in VS2005
- From: William DePalo [MVP VC++ ]
- Re: Run-time check #4 from VC in VS2005
- Prev by Date: Re: nasty compiler error in VC8
- Next by Date: Re: Member Function Templates
- Previous by thread: Re: Run-time check #4 from VC in VS2005
- Next by thread: Re: Run-time check #4 from VC in VS2005
- Index(es):