Re: So Delphi can't do this ...
From: Rob Kennedy (.)
Date: 10/12/03
- Next message: John Ullom: "Funtions and Pop Up Menu"
- Previous message: Andrew Cruickshank: "Re: Great compiler bug! - Comparing events."
- In reply to: Martin Harvey (Demon Account): "Re: So Delphi can't do this ..."
- Next in thread: Brian Cook: "Re: So Delphi can't do this ..."
- Reply: Brian Cook: "Re: So Delphi can't do this ..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 12 Oct 2003 16:23:24 -0500
Martin Harvey (Demon Account) wrote:
> Hang on - isn't this back to front?
>
> If the structure is declared as exportable from the DLL, then he
> doesn't want to define some memory that he can export as a function,
> he wants to read and write it, having imported it from the DLL
No. Microsoft Flight Simulator is the program that's importing things.
Paul's writing an add-on for FS, and FS expects to be able to import a
structure, not a function.
Since Delphi only exports functions, Brian wrote a function that takes
up the same amount of space as a record would. Since FS needs to be able
to write to that space, he also includes code to make that region of
memory writeable.
For the particular DLL at hand, I suspect this solution will work fine,
but I worry about it as a general solution for exporting data. If there
were multiple processes linking to this DLL, I think they would all get
pointers to the same region of memory rather than each getting its own
separate copy. I wonder whether how it works when exporting data in the
conventional C and C++ way.
> In which case, it's just a matter of casing the return value of
> GetProcAddress right?
Given your (incorrect) premise, I believe your conclusion is correct.
-- Rob
- Next message: John Ullom: "Funtions and Pop Up Menu"
- Previous message: Andrew Cruickshank: "Re: Great compiler bug! - Comparing events."
- In reply to: Martin Harvey (Demon Account): "Re: So Delphi can't do this ..."
- Next in thread: Brian Cook: "Re: So Delphi can't do this ..."
- Reply: Brian Cook: "Re: So Delphi can't do this ..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|