Autodesk ObjectARX
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
How to load a Managed dll from an arx file?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Greetings,
Recently I had to add some features available only in .NET, to the project I developed using ObjectArx. I created a Managed dll using C#, and I want to load that dll when my main arx dll is loaded. I do not want to demand-load that dll by adding some registry keys.
As I found the command of "acrxDynamicLinker->loadModule()" does not work for managed dlls. I am wondering if there is another command or method to load a managed dll from inside an arx file.
With thanks in advance.
Massoud
Solved! Go to Solution.
Re: How to load a Managed dll from an arx file?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
1) LoadLibrary()
2) Also acdbmgd.lib export function LoadManagedDll:
enum Acad::ErrorStatus __stdcall LoadManagedDll(ACHAR const *path);
Sample:
enum Acad::ErrorStatus __stdcall LoadManagedDll(ACHAR const *path);
static int ads_netload(void)
{
struct resbuf *pArgs = acedGetArgs () ;
acedRetNil();
if (pArgs && pArgs->restype == RTSTR) {
Acad::ErrorStatus es = LoadManagedDll(pArgs->resval.rstring);
if (es != Acad::eOk) {
acutPrintf(_T("\nLoadManagedDll(\"%s\")=%s"),
pArgs->resval.rstring,acadErrorStatusText(es));
} else
acedRetStr(pArgs->resval.rstring);
}
return (RSRSLT) ;
}
Re: How to load a Managed dll from an arx file?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Thanks for the response. But none of these methods work.
I need somehow make AutoCAD to load that managed DLL, in the same way acrxDynamicLinker->loadModule works. I do not think LoadLibrary() can do this.
The second method did not work either.
Re: How to load a Managed dll from an arx file?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
massoudshakeri wrote:
The second method did not work either.
Try again. I've attached solution which was tested with AutoCAD 2012. It export command MyNetLoad which is analog of NETLOAD command and lisp function (netload <path_to_managed_dll>)
Re: How to load a Managed dll from an arx file?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi Alexander,
Thank you very much.
It worked for me.
Best Regards
Massoud
Re: How to load a Managed dll from an arx file?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
It worked for me.
What about Accept Solution?




