Archived

This forum has been archived. Please start a new discussion on GitHub.

Ice plugins are not getting loaded?

Hi,


I am trying to create (and load) plugins into a program I'm making via the "Ice.Plugin" properties.
I followed the source until the call of ::LoadLibrary(...) and I am sure it loads the correct dll (Database_MySQL32d.dll), because in the ini-file I even added the path. (Ice.Plugin.Database_MySQL=<path>\Database_MySQL:create).

But the return from LoadLibrary == 0?? When I do the call myself, then the GetLastError() is '998' and in the output window there appears to be an "Access Violation reading from 0x0000000"...


What am I doing wrong here?

Thanks for any help :S

Comments

  • matthew
    matthew NL, Canada
    See this article for more information on your problem: PRB: LoadLibrary API Fails with 998 (ERROR_NOACCESS) Error

    It looks like your DLL startup code is causing a problem. I would follow the directions in this knowledge base article and try to narrow down the issue.
  • Hi Matthew,


    Thanks for your answer, but I also encountered this. It didn't really help.
    Afterwards I started searching for how to enable debugging of this access violation error, but couldn't find anything... Well, that's a lie. I could find something (use __try & __except with a filter() command), but it didn't break in this function.

    Isn't there a way to just put a breakpoint on it somewhere?

    Also "the startup code is wrong"... What does that mean?

    I only use 1 (exported) function:
    extern "C"
    {
      _DLL_IMP_EXP Ice::Plugin*
        create(const Ice::CommunicatorPtr& communicator, const string& name, const Ice::StringSeq& args)
      {
    ...
      }
    

    Where could I start looking for the 'startup code' of the dll?


    Thanks!
  • benoit
    benoit Rennes, France
    Hi,

    Running the application in the debugger and configuring it to stop on first chance exceptions for Access violation exceptions as suggested by the Microsoft KB article doesn't work?

    The startup code of the DLL is called when the DLL is loaded (see here for more information). Global constructors might also be executed. That's probably where your problem comes from.

    You should try to narrow down the problem by removing all the dependencies of your DLL and start from something simple. You can take a look at the IceSSL plugin for an example that works.

    Cheers,
    Benoit.
  • Thanks Benoit,


    The problem is that the VS debugger doesn't seem to allow one to put breakpoints in/on an access violation. It seems you need to use the __try/__except MS extensions together with some kind of "filter" function.
    This however did not work.

    As in the IceSSL plugin, I do not have a DllMain (or I overlooked it of course).

    Besides all this I resolved the issue and for other peoples reference: don't add release libraries to a debug dll :p.


    Thanks a lot!