link from a dll to another function in another dll?

Robert Jacques sandford at jhu.edu
Thu Apr 21 07:04:53 PDT 2011


On Thu, 21 Apr 2011 07:49:14 -0400, maarten van damme  
<maartenvd1994 at gmail.com> wrote:

> Hello, I'm back (I've been ill, nothing serious)
> I woul really like a bit more explanation with that particular approach.
> Would declaring the functions I want to keep from the renamed dll in a
> extern(c) block and linking that to the renamed dll while also declaring
> them as export work?
> And the function I want to change I declare myself and write in d?
>
> I haven't really mastered the d language and I'm simply playing around  
> with
> it, simply checking if I've understood it.
>
> 2011/4/18 Robert Jacques <sandford at jhu.edu>
>
>> On Mon, 18 Apr 2011 04:11:16 -0400, maarten van damme <
>> maartenvd1994 at gmail.com> wrote:
>>
>>  The problem with that aproach would be that the functions are in  
>> another
>>> location in the export table.
>>> I've read that the locations need to stay exactly the same.
>>> Am I wrong about this?
>>>
>>
>> I don't know for sure, but my gut would say that not knowing the exact
>> layout of the DLL is half the point. In practice, I've used D with DLLs  
>> that
>> have drastically added to/changed their layout (according to dumpbin)
>> without a problem.
>>

Hmm... It should work, but I've never tried it. Def files allow you to  
rename DLL functions, so you could rename the single function you want to  
override something else, or leave it out entirely. The only thing to be  
careful of is call style and name mangling (i.e. System vs C, etc.)


More information about the Digitalmars-d mailing list