Hi all!
I have regorganized my project for building with Visual Studi 2010, which works (building succeded). But if I try to load the ARX file to AutoCAD 2013, AxRxDynamicLinker tells me that a dependency is missing. Well, it works if I copy the ARX and all depended DLLs to the AutoCAD directory, where acad.exe is located.
Why is AutoCAD 2013 not able to load my ARX from any other directory?
Thanks in advance
Markus
Solved! Go to Solution.
Solved by Balaji_Ram. Go to Solution.
Hi Markus,
AutoCAD 2013 can also load arx from other folders.
Maybe you should use DependencyWalker to find which dependency is causing the issue.
Hi Balaji!
Thanks for your reply, but I already used Dep-Walker to figure this out. No module is missing.
Well, I forgot to mention that I used the 64Bit version of AutoCAD 2013 - and of course a 64 Bit
version of my plugin.
Just for testing I wrote a small app with a single arx file and only 1 command. This gets loaded from
AutoCAD 2013 without problems from any directory. Then I added a new DLL with an exported function,
which the command from the prior mentioned arx calls. So, the ARX is depended on the new DLL. From
now on, AutoCAD does not load the ARX anymore, telling me the a dependency is missing. The ARX
and the DLL are in the same directory.
If I copy both into the AutoCAD installation folder (where acad.exe exists), AutoCAD loads the ARX fine.
Has there anything changed?
Regards
Markus
Hi Markus,
How about adding the folder to the support path ?
This will ensure that AutoCAD will also look for dependencies here.
Dynamic-Link Library Search Order.
The fact that the dll-file and arx-file are in the same directory does not matter, because LoadLibrary looks in the directory where the exe-file instead of arx-file.
You can load external dll-file with help of LoadLibrary(or LoadLibraryEx) with full path to file. If linking is static - you can use DELAYLOAD option of linker, such as: DelayImp.lib /DELAYLOAD:"my.dll" and LoadLibrary(path+_T("my.dll")) in initialization section of arx-file.
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"
Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Thanks! Adding the path to the support path helped me out.
But this was no problem for AutoCAD 2012 and older - I am wondering about this...
Hi Markus,
Yes, I tried a sample that had dependent library in AutoCAD 2012 and it loaded correctly without having to add the folder to the support path. There seems to be a change in the behavior for AutoCAD 2013.
To me, the "LoadLibrary" method suggested by Alexander seems a better method to have the library loaded regardless how AutoCAD resolves the dependencies.
I have implicit dependencies on my DLLs. So loading is done automatically by the system. That's why the LoadLibrary hint will not work for me. The only way now is to add my path to the support-Path of AutoCAD during the setup routine.
Anyhow, thanks for the replies!
You are wrong. The proposed method (with DELAYLOAD options of linker and explicit call to LoadLibrary) works in yours case.
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"
Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn