Re: DLL help

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hello Goran and Joseph,
thank you for your comments. I'll give the recommendations a try and
your
warnings due notice.

Please tell good people here what are you actually trying to achieve,

Auto-registration of a plugin. The shared library includes an object
like so:

AutoRegistrationClass dummy("Plugin name",
factory_create_function, factory_destroy_function);

When the plugin is loaded, the constructor connects to the application
and
informs it of the plugin's meta-data. Note that the plugin is not
meant to be
used in other applications; it is not very "reusable". Also, both the
application
and plugin agree on an interface. Part of that agreement is the
existence
of an object in the calling application to register with. So while I
see both of
your concerns about exporting from the exe, I don't see it as being
the
nightmare you describe. If the symbol doesn't exist, the plugin
doesn't load.
That's appropriate behavior.

there must be a better way - and for you, too ;-).
I can and have allowed the option for the plugin implementer to
provide
callback functions. The auto-registration is meant to be a convenient
alternative. One line of code vs twenty.

Hmmm... How did you conclude that? By the time your code gets control
back from LoadLibrary, DllMain is called
I determined that because the side-effects of DllMain don't happen,
and
yet LoadLibrary() returns OK. I missed a part of an article last night
about
DllMain being a place-holder name and I have to notify the compiler.
I'll
have to see how that's done since I'm using Qt's build system and it
doesn't really let you manually add compiler options like that...

Anyway, thanks again for the advice
--Jonathan
.



Relevant Pages

  • Re: DLL help
    ... exported object in the *.exe versus having the hosting *.exe call into ... the plugin. ... I determined that because the side-effects of DllMain don't happen, ... Try to do dumpbin /exports your_dll.dll (dumpbin is a program provided ...
    (microsoft.public.vc.mfc)
  • Eclipse Plugin - Export: class not found
    ... I've written an eclipse plugin to browser JacORBs NamingService. ... export wizard config: ... Compiler Options:; both 1.4 ...
    (comp.lang.java.gui)