- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I suspect this will ultimately be revealed as a stupid question, but I can't seem to figure it out. Consider the following:
external ErrorExit
integer(4) hErrorExit
hErrorExit = %loc(ErrorExit)! address of routine ErrorExit
...
call ErrorExitLocal (%val(hErrorExit))! tell ErrorExitLocal who to call
...
subroutine ErrorExitLocal (ErrorExitSub)
external ErrorExitSub
call ErrorExitSub! actually calls ErrorExit
...
The idea here is to be able to pass the address of a main-programerror routine into a DLL, such that different programs using the same DLL can handle errors in their own ways.
VF9.1 doesn't like this construct if it checks routine interfaces, suggesting that I need an interface block, but I can't figure out what that interface block should look like. Anybody have a hint?
Bruce
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
call ErrorExitLocal(ErrorExit)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
subroutine ErrorExitLocal (PErrorExitSub)
external ErrorExitSub
pointer (PErrorExitSub, ErrorExitSub)
call ErrorExitSub! actually calls ErrorExit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's too clean!
Plus, it works. Thank you very much
Bruce
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
integer(4) hErrorExit
to:
integer(int_ptr_kind()) hErrorExit
This way it will still work under 64-bits.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page