mozart90 Posted June 6, 2006 Posted June 6, 2006 Hi is it possible to use a VisualBasic compiled dll in autoit? Must this dll then be registered or may I use the 'dllopen' command? Has anyone experiences in this? Greetings Mozart90 Easy Zip Compression using XP
Moderators SmOke_N Posted June 6, 2006 Moderators Posted June 6, 2006 Hi is it possible to use a VisualBasic compiled dll in autoit?Must this dll then be registered or may I use the 'dllopen' command?Has anyone experiences in this?Greetings Mozart90If you know the API calls to it, then you can use DLLCall() on it I'm sure. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Nomad Posted June 6, 2006 Posted June 6, 2006 Yes, like Smoke said. If you know the calls you can use a .dll compiled in any language, probably, since it's already compiled. I've never tried using a .dll compiled in VB, that I know of. But have used .dll compiled in ASM and C++ without having to do anything out of the ordinary to get it to work. Nomad
gamepin126 Posted June 7, 2006 Posted June 7, 2006 Last time I checked, you can't compile DLL's in VB. Maybe I'm wrong.
Nomad Posted June 7, 2006 Posted June 7, 2006 Last time I checked, you can't compile DLL's in VB. Maybe I'm wrong. You may be right about that, I haven't the faintest clue. I've never needed to make a .dll in VB so I've never looked into whether you could or not. ASM is usually the way to go with a .dll. Nomad
gamepin126 Posted June 7, 2006 Posted June 7, 2006 (edited) Actually, it's possible. You'll need to use ActiveX and make a loader that will basically turn it into a exe. So, it's really pointless and you need to be godly at VB to do it. Edited June 7, 2006 by gamepin126
dnsi Posted June 7, 2006 Posted June 7, 2006 How do you even compile a dll with vb6. I haven't figured it out yet! My Programs:Flip-Flop File Encryption SysyemMULTIPLAYER-SOCKETSERVERHide An Archive In A Picture
gamepin126 Posted June 7, 2006 Posted June 7, 2006 How do you even compile a dll with vb6.I haven't figured it out yet!It's not that straight forward. I'm no expert on VB, so I'll stop talking.
mozart90 Posted June 7, 2006 Author Posted June 7, 2006 (edited) hi perhaps I write what I did. So it is more practical... In VB I opend a new ActiveX Dll Project and wrote the following code: (I want to mention this is only an example - I know there is a much easier method to get the windows system dir in autoit but that is not the question ...) ' Vb Code: The function WinDir will return the Windows Directory as a string Private Declare Function GetWindowsDirectory Lib "KERNEL32" _ Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, _ ByVal nSize As Long) As Long Public Function WinDir() As String Dim sDirBuf As String * 255 StrLen = GetWindowsDirectory(sDirBuf, 255) WinDir = Left$(sDirBuf, StrLen) End Function Then the Classmodule was renamed to WINSYSDIR After that I compiled the dll to the name testdll.dll Then registering with regsvr32 .... With the following code I can access the dll in VB Sub Form_Load() Dim Folder As New WINSYSDIR ' creates the object MsgBox Folder.WinDir ' calls the function End Sub My poorly try to translate it io autoit looks like that $obj = objcreate("WINSYSDIR") $ret= $a.windir msgbox(0,"info",$ret) or the other way with dllcall would be: DllOpen(@ScriptDir & "\testdll.dll") $ret= DllCall("testdll","str","Windir") msgbox(0,"info",$ret) But both ways do not work ... Perhaps it helps attatching the dll ... So here it is .. Greetings Mozart90 testdll.dll Edited June 7, 2006 by mozart90 Easy Zip Compression using XP
ZacGod Posted October 12, 2006 Posted October 12, 2006 hi perhaps I write what I did. So it is more practical... In VB I opend a new ActiveX Dll Project and wrote the following code: (I want to mention this is only an example - I know there is a much easier method to get the windows system dir in autoit but that is not the question ...) ' Vb Code: The function WinDir will return the Windows Directory as a string Private Declare Function GetWindowsDirectory Lib "KERNEL32" _ Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, _ ByVal nSize As Long) As Long Public Function WinDir() As String Dim sDirBuf As String * 255 StrLen = GetWindowsDirectory(sDirBuf, 255) WinDir = Left$(sDirBuf, StrLen) End Function Then the Classmodule was renamed to WINSYSDIR After that I compiled the dll to the name testdll.dll Then registering with regsvr32 .... With the following code I can access the dll in VB Sub Form_Load() Dim Folder As New WINSYSDIR ' creates the object MsgBox Folder.WinDir ' calls the function End Sub My poorly try to translate it io autoit looks like that $obj = objcreate("WINSYSDIR") $ret= $a.windir msgbox(0,"info",$ret) or the other way with dllcall would be: DllOpen(@ScriptDir & "\testdll.dll") $ret= DllCall("testdll","str","Windir") msgbox(0,"info",$ret) But both ways do not work ... Perhaps it helps attatching the dll ... So here it is .. Greetings Mozart90 testdll.dll This thread may be VERY old but you can work with the two together using VBAdvance it comes with the templates to work with. Although Forms in VB6 dlls run as a loop so your autoit application will freeze as long as the visual basic form is being displayed. But by loading the autoit dll into VB6 i cannot seem to get GetMousePos() to return correctly since normally it returns an array
dnsi Posted October 14, 2006 Posted October 14, 2006 NOT WORKING... The dll Function Scanner Returned Nothing... My Programs:Flip-Flop File Encryption SysyemMULTIPLAYER-SOCKETSERVERHide An Archive In A Picture
mozart90 Posted May 15, 2007 Author Posted May 15, 2007 (edited) ... very old thread but a long time ago I postetd a solution Howto use a VB6 dll with autoitHow to use a self compiled VB6 dll with AutoIt, Include Visual Basic 'Functions' as DLL in AutoIt:http://www.autoitscript.com/forum/index.php?showtopic=27389regards mozart90 Edited May 15, 2007 by mozart90 Easy Zip Compression using XP
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now