Jump to content


Photo

Getting started with AutoHotkey.dll


  • Please log in to reply
15 replies to this topic

#1 Gast (w/ nick)

Gast (w/ nick)
  • Members
  • 113 posts

Posted 29 July 2010 - 11:09 AM

Hi,

I'm trying to find out how AutoHotkey.dll works.
I need to add some unicode string conversions to a
non-unicode application and I though that I could use
AHK.DLL to help here, instead of calling compiled ahk-exe.files
all the time.

I tried to get the information here:
<!-- m -->http://www.autohotke...tinku99/ahkdll/<!-- m -->

Alas the "AhkDll.chm" file available on the same site doesn't work -
it only contains an index, but no help text - and there seems to other documentation around.

The download also contains two different releases "ReleaseA" and
"ReleaseU" in the zip file, with two dlls in each.

Totally confusing - anybody know which dll I should use for a simple
hello world project?

#2 HotKeyIt

HotKeyIt
  • Fellows
  • 6134 posts

Posted 29 July 2010 - 11:19 AM

AhkDll.chm works fine for me. In my signature you can find same help online.
ReleaseA stands for ANSI version.
ReleaseU stands for Unicode version.

Is your non-unicode application written in Autohotkey?

#3 Gast (w/ nick)

Gast (w/ nick)
  • Members
  • 113 posts

Posted 29 July 2010 - 12:34 PM

Thanks for the online-help link.

I tried the chm-file on two German WindowsXP computers,
both display the content on the left side, but nothing in
index/search and the right side always shows
"The navigation to the web site was cancelled" (in German)

Is your non-unicode application written in Autohotkey?


It's a database application that let's me use registred dlls.
Alas registring the dll doesn't work for me, yet:

When I try to register autohotkey.dll using the command:
regsvr32.exe autohotkey.dll

I get the "DllRegisterServer entry point was not found" error message.

#4 HotKeyIt

HotKeyIt
  • Fellows
  • 6134 posts

Posted 29 July 2010 - 01:03 PM

Did you google that problem?

I have no idea about regsvr32.exe.

The only Dll entry in AutoHotkey.dll is DllMain which is called when using LoadLibraryor FreeLibrary.

#5 Gast (w/ nick)

Gast (w/ nick)
  • Members
  • 113 posts

Posted 29 July 2010 - 01:37 PM

Thanks for the reply.

Did you google that problem?
I have no idea about regsvr32.exe.


Yes, no success in getting it to work.
I understand what the problem is, now.

On wikipedia (http://en.wikipedia.org/wiki/Regsvr32) it says

regsvr32 is a command-line utility in Microsoft Windows operating systems for registering and unregistering DLLs and ActiveX controls in the Windows Registry.[1]

To be used with regsvr32, a DLL must export the functions DllRegisterServer and DllUnregisterServer.[2]


So if there's only a DllMain in Autohotkey.dll then this can't work.

This means registering Autohotkey.dll automatically will fail.
As a consequence applications that are only allowed to call
registred DLLs in Windows won't see it and can't use it.

There might be a manual workaround to get Autohotkey.dll
registred...

#6 HotKeyIt

HotKeyIt
  • Fellows
  • 6134 posts

Posted 29 July 2010 - 07:33 PM

Have you tried simply copying it to C:\Windows\system32\AutoHotkey.dll :?:
As far as I understand there is no need to register AutoHotkey.dll.
:arrow: http://www.codeguru....p/t-307450.html

How do you load a dll in your application?

#7 Guests

  • Guests

Posted 29 July 2010 - 09:08 PM

Did you searching it in ahk forum if not then press http://adf.ly/4b3V

#8 Gast (w/ nick)

Gast (w/ nick)
  • Members
  • 113 posts

Posted 30 July 2010 - 07:15 AM

Have you tried simply copying it to C:\Windows\system32\AutoHotkey.dll :?:


Yes.

How do you load a dll in your application?


There's an internal datatype called automation which can be connected to registred dlls.

To get to one, I create a variable of the type automation and then select
a registred DLL or OCX by it's Name, like for example(*)
'Windows Script Host Object Model'.WshShell

Internally the application stores this like this:
Automation "{F935DC20-1CF0-11D0-ADB9-00C04FD58A0B} 1.0:{72C24DD5-D70A-438B-8A42-98424B88AFB8}:'Windows Script Host Object Model'.WshShell";

When I open the source code on a machine that doesn't have the object registred, it will even fail to compile the source code and display "Unknown Automation Server.Unknown Class"

--
(*) I know, it's not a perfect example because Windows Script Host is not a dll. But the process is the same for dlls and works for those I could register

#9 HotKeyIt

HotKeyIt
  • Fellows
  • 6134 posts

Posted 30 July 2010 - 04:00 PM

This is for COM dlls, there must be a different process for simple dlls. What is the name of your app.

#10 Gast (w/ nick)

Gast (w/ nick)
  • Members
  • 113 posts

Posted 02 August 2010 - 02:42 PM

there must be a different process for simple dlls. What is the name of your app.


Microsoft Dynamics NAV (Classic). It's a 4GL database & programming environment which has a very limited set of commands. The focus is on the database part, which is really nice. The programming side is pretty awful and lacks almost anything.

There is no way for calling simple dlls. Apart from the OCX/COM DLLs I can run compiled AHK scripts via the 'Windows Script Host Object Model'.WshShell and that's about it. This is why marrying it to AHK to do some dirty work would be very useful.

#11 HotKeyIt

HotKeyIt
  • Fellows
  • 6134 posts

Posted 13 October 2010 - 06:22 AM

Since Revision H26 a COM Interface is build in for AutoHotkey.dll, so this will work now.
AutoHotkey COM Interface

#12 jethrow

jethrow
  • Fellows
  • 2549 posts

Posted 28 February 2012 - 12:47 AM

When I try to register autohotkey.dll using the command:
regsvr32.exe autohotkey.dll

I get the "DllRegisterServer entry point was not found" error message.


I am getting this on WIN7 x64.

#13 HotKeyIt

HotKeyIt
  • Fellows
  • 6134 posts

Posted 28 February 2012 - 07:12 AM

Hm.., I can't test currently.
Are you using latest version (1.1.06.02)?

#14 jethrow

jethrow
  • Fellows
  • 2549 posts

Posted 28 February 2012 - 07:23 AM

Interesting - I redownloaded it, & it's saying it successfully registered, but creating an AutoHotkey.Script object fails:

0x800401F3 - Invalid class string



#15 tinku99

tinku99
  • Members
  • 560 posts

Posted 01 March 2012 - 07:43 AM

Interesting - I redownloaded it, & it's saying it successfully registered, but creating an AutoHotkey.Script object fails:

0x800401F3 - Invalid class string

unfortunately, windows7 seems to require admin privileges to really successfully register a com dll... when you're not admin, it just lies to you...