LOADCTRLS problem

LOADCTRLS problem

ubstov
Explorer Explorer
2,411 Views
3 Replies
Message 1 of 4

LOADCTRLS problem

ubstov
Explorer
Explorer

I have encountered and issue when trying to demand load my .NET dll.  I'm using AutoCAD 2011 and I can successfully load the dll with my LOADCTRLS registry entry value of 2 (Loading on startup), but my desire is to load it on command invocation.  I have COMMANDS keys defiined and I have tried changing the value of LOADCTRLS to 4, 8 and a combination of both (which is "c" in hex), but always with the same result of "Unknown command".  Any ideas on why it will load on startup but not on command invocation would be helpful.  Here are the reg entries...

 

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R18.1\ACAD-9001:409\Applications\MyApp]
"LOADCTRLS"=dword:0000000c
"MANAGED"=dword:00000001
"LOADER"="C:\\MyApp\\MyApp.dll"
"DESCRIPTION"="My Application"

[HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R18.1\ACAD-9001:409\Applications\MyApp\Commands]
"sma"="sma"

0 Likes
2,412 Views
3 Replies
Replies (3)
Message 2 of 4

cadMeUp
Collaborator
Collaborator

Check the value of the DEMANDLOAD system variable, that could be the issue. If it is set to 0 or 1 then the app won't load on command invocation, if set to 2 or 3 then it will.

0 Likes
Message 3 of 4

ubstov
Explorer
Explorer

Thanks for the info.  I did check the DEMANDLOAD system variable and it is set to 3 (Object detect and command invoke).  Is there something else that I'm missing?

0 Likes
Message 4 of 4

cadMeUp
Collaborator
Collaborator

It's hard to tell without seeing all of your project code, references. Maybe with command invocation referenced files might not automatically load, you could have references that may not be loading. Seems like there is some kind of error in the load process and it prevents your net app from loading properly. You might try creating another project/app with a simple "Hello World" command, make the project as simplified as possbible without any references other than required AutoCAD refs, create a test entry for the dll app in your registry that's set to load on command invoke and see what you get. Hopefully that will work and then you'll know the problem is within your application code somewhere.

 

Hope you get it figured out. I haven't run into this problem with command invoke. I have run into situations where modules would not load because of missing or unloaded references.

0 Likes