Jump to content
Sign in to follow this  
yokyok

i cant add reference autoitx3.dll

Recommended Posts

yokyok

hi

i use C#/visual studio 2010 . I'm getting this error when trying to add the reference.

Posted Image

help please thanks.

Share this post


Link to post
Share on other sites
Laymanball

Add File AutoItX3.dll in system32 folder and rightClick AutoItX3.dll file. Choosed Register. Endjoy.


My Sample Script

Download: VistaDesktopIconsChangerForXp.au3 (Com,Doc and Bin only) http://www.4shared.com/rar/NMHYL5Igba/VistaDesktopIconsChangerForXp_.html

                     VistaDesktopIconsChangerForXp.exe (Resources) http://www.4shared.com/rar/nzs7Mb1gba/VistaDesktopIconsChangerForXp_.html

Share this post


Link to post
Share on other sites
Richard Robertson

I am pretty sure that it does have to be globally registered in COM before Visual Studio will use it as a reference.

Share this post


Link to post
Share on other sites
Laymanball

Copy file AutoItX3.dll and Paste in to System32 folder and register dll file and using command with add Reference Com. Choosed AutoItX3 1.0 Type Library.

Exsample some command in AutoItX3Lib to VB.net

Imports AutoItX3Lib
Public Class Form1
    Private oAutoIt As New AutoItX3
    WithEvents btn1 As New System.Windows.Forms.Button
    Public Sub New()
        InitializeComponent()
        Me.CenterToScreen()
        btn1.Text = "ToolTip Test"
        btn1.Cursor = Cursors.Hand
        btn1.Location = New Point(100, 100)
        Me.Controls.Add(btn1)
    End Sub
    Private Sub btn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn1.Click
        Try
            oAutoIt.ToolTip("Hello World!", 450, 300)
            oAutoIt.Sleep(2000)
            oAutoIt.ToolTip("")
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub
End Class

OR

Public Class Form1
    Private oAutoIt As Object
    WithEvents btn1 As New System.Windows.Forms.Button
    Public Sub New()
        InitializeComponent()
        Me.CenterToScreen()
        btn1.Text = "ToolTip Test"
        btn1.Cursor = Cursors.Hand
        btn1.Location = New Point(100, 100)
        Me.Controls.Add(btn1)
    End Sub
    Private Sub btn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn1.Click
        Try
            oAutoIt = Microsoft.VisualBasic.CreateObject("AutoItX3.Control")
            oAutoIt.ToolTip("Hello World!", 450, 300)
            oAutoIt.Sleep(2000)
            oAutoIt.ToolTip("")
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub
End Class

OR

Imports System.Runtime.InteropServices
Public Class Form1
    WithEvents btn1 As New System.Windows.Forms.Button
    <DllImport("AutoItX3.dll", CharSet:=CharSet.Auto)> _
    Private Shared Sub AU3_ToolTip(ByVal strTip As String, ByVal x As Integer, ByVal y As Integer)
    End Sub
    Public Shared Sub ToolTip(ByVal strTip As String, ByVal x As Integer, ByVal y As Integer)
        AU3_ToolTip(strTip, x, y)
        Return
    End Sub
    Public Shared Sub ToolTip(ByVal strTip As String)
        AU3_ToolTip(strTip, x:=0, y:=0)
        Return
    End Sub
    Public Sub New()
        InitializeComponent()
        Me.CenterToScreen()
        btn1.Text = "ToolTip Test"
        btn1.Cursor = Cursors.Hand
        btn1.Location = New Point(100, 100)
        Me.Controls.Add(btn1)
    End Sub
    Private Sub btn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn1.Click
        Try
            ToolTip("Hello World!", 450, 300)
            Threading.Thread.Sleep(2000)
            ToolTip("")
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub
End Class
Edited by Laymanball

My Sample Script

Download: VistaDesktopIconsChangerForXp.au3 (Com,Doc and Bin only) http://www.4shared.com/rar/NMHYL5Igba/VistaDesktopIconsChangerForXp_.html

                     VistaDesktopIconsChangerForXp.exe (Resources) http://www.4shared.com/rar/nzs7Mb1gba/VistaDesktopIconsChangerForXp_.html

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×