Call for Submission
NAB 2012 Best of the Best Show Reel
Submit your work today!
  • 1/3
You are here: Forum Home / Autodesk® Maya® / SDK / where should i put B.dll if my A.mll depends on it?
  RSS 2.0 ATOM  

where should i put B.dll if my A.mll depends on it?
Rate this thread
 
35433
 
Permlink of this thread   Subscribe to this thread
avatar
  • yaoyansi
  • Posted: 10 October 2009 07:29 PM
  • Total Posts: 26
  • Joined: 29 September 2009 06:37 AM

hi, all

I write a plugin A.mll, and it depends on project B.
B is an open source project, and it can generate B.dll.and B.lib.

Case 1:
I link B.lib in my project(MSVC2005), A.mll depends on B.dll. (I check A.mll by a dll viewer, and find that A.mll uses serveal functions in B.dll )
Then, I import A.mll in maya PluginManager, and it complains:
// Error: file: D:/Maya2009ROOT/scripts/others/pluginWin.mel line 663:
Unable to dynamically load : E:/MyProjectRoot/A.mll
The specified module could not be found.

The complains still exists even i put B.dll into Maya2009ROOT\bin\plug-ins\B\ .

Case2:
I include source code of B project and don’t link B.lib in my project(MSVC2005) . This time, A.mll doesn’t depend on B.dll anymore, I’m sure of this by the dll viewer.
This time, A.mll can be imported in maya. Every thing is fine.

But how to solve the problem in Case 1? Assuming that B is not open source, and my project depends on B.dll and B.lib.

Thanks in advance.



Replies: 0
avatar
  • TravF
  • Posted: 11 October 2009 04:53 AM

The search for DLL dependencies usually follow this order:

1. The directory from which the application loaded.
2. The system directory. Use the GetSystemDirectory function to get the path of this directory.
3. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
4. The current directory.
5. The directories that are listed in the PATH environment variable.

Just for testing, remove the dependency for your .DLLs and call GetCurrentDirectory() to see
where Maya is currently looking.  Place all DLLs there.  This is just a hack and probably won’t always work.

Another way to solve your problem, use LoadLibrary to load your .DLL.  Then, before loading it,
use the SetCurrentDirectory() to set it where your plugin is located.



Replies: 0
avatar
  • Location: Saint-Petersburg, Russia
  • Total Posts: 1
  • Joined: 16 October 2008 10:43 PM
  • Permlink of this post

I have the same problem but it is comes when i try to load a plugin, “Unable to dynamically load: “



Replies: 0
avatar
  • yaoyansi
  • Posted: 25 December 2009 05:52 PM

I solved this problem by put B.dll to MayaRoot\bin directory. But i don’t think this is the best solution.



Replies: 0




   
  Settings Choose Theme color: