- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have been using CVF-created dll's from Delphi-created apps for about a year and everything seems to be operating OK. However, in the new CALLDVF (from Delphi) example it states that Dephi prepends an underscore and so the Fortran function (or procedure) needs to be appropriately ALIASed. None of my functions are so ALIASed and there has never been a problem. I'm confused...
Bill D. Richards
North Idaho College
Bill D. Richards
North Idaho College
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm not familiar with Delphi - I see that the CALLDVF example expects Delphi to use the C naming conventions (downcased name and prepended underscore) but the STDCALL calling conventions. Strange. Perhaps it depends on what your Delphi code looks like?
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is a sample of the Delphi function declaration (after reading the Delphi reference, which has a great section on parameter passing conventions, I declared all function calls as STDCALL):
and the fuinction in CVF is as:
I guess the STDCALL convention seems to be the best for me, you still have to make sure of the case of the function name, though.
Bill
Function FDSCANSHEET(sheet : pchar; lsheet : integer; id : pchar; lid : integer; pform : pchar; lform : integer; Var iside : integer; Var iessay : integer) : integer; stdcall; external 'par.dll';
and the fuinction in CVF is as:
INTEGER function fdScanSheet(s1,id,form,side,essaypts) use scanstuffmodule use dflib character(LEN=*),intent(INOUT) :: s1,id,form integer(4),intent(INOUT) :: side,essaypts !DEC$ ATTRIBUTES DLLEXPORT :: FDSCANSHEET !DEC$ ATTRIBUTES ALIAS:'FDSCANSHEET' :: FDSCANSHEET
I guess the STDCALL convention seems to be the best for me, you still have to make sure of the case of the function name, though.
Bill
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page