.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Load a .dll from desktop shortcut?

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
quigs
953 Views, 3 Replies

Load a .dll from desktop shortcut?

Hello,

I have a .dll that uses registry entries to load itself when AutoCAD starts.

But I have encountered a problem where it also loads even

When a customer chooses to load another AutoCAD plugin by another vendor.

 

I would like it ideally only to be loaded when the user clicks on my desktop shortcut.

 

I am writing in VB.net & have noticed some vendors use a reference to

object.arx in their shortcut.  Is it possible to do this with a vb.net .dll or even a lisp?

 

Any help would be greatly appreciated.

 

Martin.

My name is Martin.. 😄
3 REPLIES 3
Message 2 of 4
dgorsman
in reply to: quigs

Couple of ways of doing this, I think.  Might depend on what your desktop shortcut does e.g. point to a specific profile?  The demand-load flags are set in the HKEY_LOCAL_MACHINE section of the registry so they don't depend on a specific profile.  Not sure, there may be additional sections in the HKCU for newer versions but I think those are still independant of a specific profile.

 

One is to change the demand-load settings to command-detect, provided you have commands defined; no command issued, no DLL loaded.

 

Another would be to use a "loader" DLL, LSP, MNL, etc. as an intermediary to check the profile name at start-up.  If its the correct profile name (or other circumstances) then make a call to System.Reflection (dotNET), (command "NETLOAD"...) (LISP), etc.  You still need to load the "loader", but it can be much less obtrusive.

 

You could also modify the shortcut to call a start-up script (/b I think...) which makes a call to NETLOAD.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 3 of 4
chiefbraincloud
in reply to: dgorsman

I was also going to suggest the use of an .MNL file matching the name of the .cuix, which would cause the .dll to be netloaded whenever the .cuix was loaded, however, it is worth pointing out that just about no matter what you do, a savvy user will still be able to figure out how to load your .dll without using your shortcut.

 

If you have a specific case where you do not want your .dll to be loaded, then the only suggestion I would have is that in your applications Initialize routine (assuming you are implementing iExtensionApplication) you can test for conditions that you don't want, and throw an exception, which will prevent your app from loading.

Dave O.                                                                  Sig-Logos32.png
Message 4 of 4
quigs
in reply to: chiefbraincloud

Hi Guys,

I manged to do it using a script file refereced from the shortcut.

 

Cheers

 

Martin.

My name is Martin.. 😄

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost