DLLs and headaches

Don nospam at nospam.com
Mon May 4 01:16:34 PDT 2009


Unknown W. Brackets wrote:
> This is kinda complicated, hopefully someone will still read it and try it.
> 
> DLLs typically don't have access to the host process.  Sometimes, when 
> creating plugins, such access may be desirable.  The typical solution is 
> to have the host and plugins both load a secondary DLL.
> 
> I've tried to replicate this with D.  I have a stub program, a "primary" 
> dll, and a "plugin" dll.
> 
> Although the solution in itself does work, I'm having a lot of problems 
> and they seem related to D.  But, maybe I'm just doing it all wrong?
> 
> If I import std.stdio in a DLL, it won't compile.  Period.  Otherwise, 
> the primary DLL never finishes - it just dies when it frees the plugin 
> library.

Is this D1 or D2?
If D2 -- I haven't been able to get D2 DLLs to work at all. They just 
crash during the initialization (something to do with initialising the 
thread-locals, I think, but I haven't been able to track it down 
completely).


More information about the Digitalmars-d-learn mailing list