Error loading a 3ds plugin that refers to a dependency dll

Error loading a 3ds plugin that refers to a dependency dll

Anonymous
Not applicable
1,646 Views
6 Replies
Message 1 of 7

Error loading a 3ds plugin that refers to a dependency dll

Anonymous
Not applicable

Hello. I'm in the process of writing a 3ds plugin and have been hitting an error when launching 3ds Max. Here's the error that I'm getting.

 

DLL <C:\Program Files\Autodesk\3ds Max 2020\Plugins\TestPlugin.dlo> failed to initialize. Error code 126 - The specified module could not be found.

 

I understand this is a fairly common error but the suggested solutions I've seen so far haven't helped in this case. I think what's causing the issue is that my plugin is dependent on another dll that I have. So the TestPlugin.dlo plug in makes references to a separate dll called MainProject.dll that contains my custom code. The problem seems to be that when the plugin loads, the MainProject.dll hasn't been properly loaded and the plugin produces the error. From troubleshooting I've found that TestPlugin.dlo will load successfully in 3ds if I remove any references to the code in MainProject.dll first. So this tells me that there's something wrong with the relationship between these.

 

Could anyone advise what is the right way to deploy a plugin and the dll that it's dependent on? I also have a .lib file (MainProject.lib) that corresponds to the MainProject.dll.  If someone could confirm where the .dlo, .dll, and .lib files need to be deployed to, that would be a huge help. Also, I've looked into whether I need to include a manifest file or if using delayed loading will be necessary. Though I haven't found anything that looks like a solution yet.

 

Thanks very much for the help! I'd be glad to hear any thoughts or recommendations.

 

Note: I'm using the 2020 version of 3ds Max.

0 Likes
1,647 Views
6 Replies
Replies (6)
Message 2 of 7

istan
Advisor
Advisor

You wrote, you are also deploying LIB files. Consider, your users will then also need all include files.

.LIB, .H, .CPP you can put wherever you want.

 

https://help.autodesk.com/view/3DSMAX/2020/ENU/?guid=__developer_3ds_max_sdk_features_miscellaneous_...

 

https://help.autodesk.com/view/3DSMAX/2020/ENU/?guid=__developer_writing_plug_ins_packaging_plugins_...

 

Easiest is to put all your additional DLLs you need for your plugins, to the install root of Max..

 

0 Likes
Message 3 of 7

Anonymous
Not applicable

Hello Istan. Thanks very much for the advice. I think deploying it as a plugin package is a good suggestion. I'm working on doing that now but am currently getting a different error related to the secondary dll.

 

Here's the error that I'm seeing,

 

Could not load file or assembly 'file:///c:programdata\autodesk\applicationplugins\myplugin\content\MainProject.dll' or one of its dependencies. The module was expected to contain an assembly manifest.

 

Do you know if I need to provide a manifest file for any other dlls that my plugin refers to? Thank you again for your help!

0 Likes
Message 4 of 7

istan
Advisor
Advisor

is it c# ?

0 Likes
Message 5 of 7

Anonymous
Not applicable

Hi. It's in C++. Thanks!

0 Likes
Message 6 of 7

istan
Advisor
Advisor

Since Max9 I always use the same sln/vcproj files and I never had to add a manifest file - I would not even know how to create it 😉

Besides that, your plugin path seem not to be the standard path? Mine are in "$(3dsmax_root_path)/plugins".

0 Likes
Message 7 of 7

Anonymous
Not applicable

Thanks a lot for the advice, Istan. I'll try to change the plugin path as you mentioned and see if that helps.

 

Otherwise, I think it probably makes sense for me to post a new question to the board about assembly manifests for custom dlls. That seems like a bit of a different issue than the one I originally posted about. So maybe someone has seen a similar error about missing assembly manifests.

 

Thank you. Enjoy your day.

0 Likes