Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 06-29-2007
g00fy g00fy is offline
Registered User
 
Name: Salvania
Organization: Salvania
Project: Database systems
 
Join Date: Dec 2005
Posts: 45
Send a message via ICQ to g00fy
-->
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:c reate).

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
__________________
Steven Van Ingelgem
Salvania [http://www.salvania.be/]
Product Descr.: Statistical data analysis
Reply With Quote
  #2 (permalink)  
Old 06-29-2007
matthew's Avatar
matthew matthew is online now
ZeroC Staff
 
Name: Matthew Newhook
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Feb 2003
Location: NL, Canada
Posts: 1,088
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.
Reply With Quote
  #3 (permalink)  
Old 06-30-2007
g00fy g00fy is offline
Registered User
 
Name: Salvania
Organization: Salvania
Project: Database systems
 
Join Date: Dec 2005
Posts: 45
Send a message via ICQ to g00fy
-->
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:
Code:
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!
__________________
Steven Van Ingelgem
Salvania [http://www.salvania.be/]
Product Descr.: Statistical data analysis
Reply With Quote
  #4 (permalink)  
Old 07-02-2007
benoit's Avatar
benoit benoit is offline
ZeroC Staff
 
Name: Benoit Foucher
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Rennes, France
Posts: 1,564
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.
Reply With Quote
  #5 (permalink)  
Old 07-02-2007
g00fy g00fy is offline
Registered User
 
Name: Salvania
Organization: Salvania
Project: Database systems
 
Join Date: Dec 2005
Posts: 45
Send a message via ICQ to g00fy
-->
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 .


Thanks a lot!
__________________
Steven Van Ingelgem
Salvania [http://www.salvania.be/]
Product Descr.: Statistical data analysis
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Traditional DLL being loaded by .NET DLL - Unable to Find dependencies mboozell Help Center 3 05-02-2007 10:51 AM


All times are GMT -4. The time now is 12:17 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.