Author Topic: Managed HotKeys  (Read 53903 times)

0 Members and 1 Guest are viewing this topic.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Managed HotKeys
« Reply #90 on: June 28, 2010, 07:37:09 PM »
Hi Daniel
I think this is the latest

http://www.theswamp.org/index.php?topic=31924.msg374004#msg374004

I haven't made time to look at it.
There were no exceptions thrown though ...
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Managed HotKeys
« Reply #91 on: June 28, 2010, 07:40:39 PM »

May be an idea to add something like this to the Initialize()  and the  keysOn() ,  keysOff() <- with 'unloaded' message

                docMan.MdiActiveDocument.Editor.WriteMessage(
                        "\nHotkeys_2010/11 are loaded.\n Commands : KeysOn, KeysOff, KeysToggle, KeysConfig, EditKeys");


kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8662
  • AKA Daniel
Re: Managed HotKeys
« Reply #92 on: June 28, 2010, 09:16:20 PM »
Try this one


Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Managed HotKeys
« Reply #93 on: June 28, 2010, 09:50:08 PM »

Thanks Dan

eFilerError
   at
Autodesk.AutoCAD.DatabaseServices.ImpHostApplicationServices.FindFile(String
fileName, Database database, FindFileHint hint)
   at HotKeys.KeysFile.locateKeysFile()
   at HotKeys.AppRegistry.initialize()
   at HotKeys.Main.Initialize()
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8662
  • AKA Daniel
Re: Managed HotKeys
« Reply #94 on: June 28, 2010, 10:04:43 PM »
Great!

We should probable put this in a FAQ somewhere, if you use IExtensionApplication, add a try catch

Code: [Select]
   public void Initialize()
    {
      try
      {
       //todo
      }
      catch (System.Exception ex)
      {
        Autodesk.AutoCAD.ApplicationServices.Application.
          DocumentManager.MdiActiveDocument.Editor.
          WriteMessage("\n{0}\n{1}", ex.Message, ex.StackTrace);
      }
    }

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Managed HotKeys
« Reply #95 on: June 28, 2010, 10:05:16 PM »
Looks like the Registry entrys are not being made.
I thought the initial initialize added the entrys if they didn't exist ...

This is the reg after running the netload ..

[added]
and the same under
HKEY_CURRENT_USER\Software\ManagedHotKeys
HKEY_USERS\S-1-5-21-1614435629-549356334-4198987207-1000\Software\ManagedHotKeys
 
« Last Edit: June 28, 2010, 10:12:18 PM by Kerry Brown »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Managed HotKeys
« Reply #96 on: June 28, 2010, 10:07:56 PM »
Great!

We should probable put this in a FAQ somewhere, if you use IExtensionApplication, add a try catch

Code: [Select]
   public void Initialize()
    {
      try
      {
       //todo
      }
      catch (System.Exception ex)
      {
        Autodesk.AutoCAD.ApplicationServices.Application.
          DocumentManager.MdiActiveDocument.Editor.
          WriteMessage("\n{0}\n{1}", ex.Message, ex.StackTrace);
      }
    }

Great idea 
If you like I'll add a reference into the 'Getting Started' Series.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8662
  • AKA Daniel
Re: Managed HotKeys
« Reply #97 on: June 28, 2010, 10:11:34 PM »
where is your xml file?
look under HKEY_CURRENT_USER\Software\ManagedHotKeys

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Managed HotKeys
« Reply #98 on: June 28, 2010, 10:15:34 PM »
where is your xml file?
look under HKEY_CURRENT_USER\Software\ManagedHotKeys

No entry
as posted in piccy.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8662
  • AKA Daniel
Re: Managed HotKeys
« Reply #99 on: June 28, 2010, 10:16:04 PM »
From the looks of it, the XML file must be in a search path, or in My documents.. where is yours?

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Managed HotKeys
« Reply #100 on: June 28, 2010, 10:19:01 PM »
In the same folder as the .DLL  ... NOT on the Search Path
both the default xml and my personal renamed modified xml.


What are your thoughts on this ??
Personally I'd rather not need to modify the Search path.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8662
  • AKA Daniel
Re: Managed HotKeys
« Reply #101 on: June 28, 2010, 10:32:01 PM »
quick fix, put a file called HotKeys.xml in my documents.
launch Acad and load dll.
use the keysconfig command to locate your personal xml

this should save the setting in the reg.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Managed HotKeys
« Reply #102 on: June 28, 2010, 10:38:53 PM »
quick fix, put a file called HotKeys.xml in my documents.
launch Acad and load dll.
use the keysconfig command to locate your personal xml

this should save the setting in the reg.

:)

Just came back to say I'd done exactly that ... and it worked fine.
I'll look at the options when I get a chance ... unless someone beats me to it.

Thanks Dan

Regards
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8662
  • AKA Daniel
Re: Managed HotKeys
« Reply #103 on: June 28, 2010, 10:40:00 PM »
@ Chuck -- Rule #1749-5 of the programmers handbook, always test your code on a virgin machine   :lol:

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Managed HotKeys
« Reply #104 on: June 28, 2010, 10:42:46 PM »
Just as a note for later

the

 (int)AppDomain.GetCurrentThreadId());

is depricated.


[added]
Also for later ..
perhaps a .NET editor for the XML files to replace the current VB6 editor.
« Last Edit: June 28, 2010, 10:52:50 PM by Kerry Brown »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.