Jump to content

Recommended Posts

Posted (edited)

Ever wondered how to interact with your compiled .NET assembly and AutoIt script using COM? Then look no further, as I try to explain in simple terms the approach at which to achieve this.

The code (AutoIt):

As quite a few of you know, I am against the use of Global variables, as more often than not a simple approach such as encapsulating a Local Static variable in a wrapper function is just as good. Some may point out the use of the enumeration, but this is only for the purposes of doing away with "magic numbers", with the chances to expand in the future and not having to remember which number represents what etc...

To create the .NET dll:

In Visual Studio select a new project and class library. From there, go ahead and rename the namespace and class to something meaningful as you will need it later on when you connect to the COM interface of your .NET assembly. Add [ComVisible(true)] above the class declaration line << IMPORTANT.

Once you've added all your wonderful C# related code, build the assembly and copy the .dll file to the location of your AutoIt script. Then it's just as simple as calling the _DotNet_Load() function with the filename of the .dll and voila, you have the power of AutoIt and .NET in one script.

Example use of Functions:

#include <File.au3>

Global Const $DOTNET_PATHS_INDEX = 0, $DOTNET_REGASM_OK = 0
Global Enum $DOTNET_LOADDLL, $DOTNET_UNLOADDLL, $DOTNET_UNLOADDLLALL ; Enumeration used for the _DotNet_* functions.
Global Enum $DOTNET_PATHS_FILEPATH, $DOTNET_PATHS_GUID, $DOTNET_PATHS_MAX ; Enumeration used for the internal filepath array.

#cs
    NOTE: Don't forget to add [ComVisible(true)]  to the top of the class in the class library. Otherwise it won't work.
#ce

Example() ; A simple example of registering and unregistering the AutoIt.dll

Func Example()
    If _DotNet_Load('AutoIt.dll') Then ; Load the .NET compiled dll.
        Local $oPerson = ObjCreate('AutoIt.Person') ; Namespace.Class.
        If IsObj($oPerson) Then
            $oPerson.Name = "guinness"
            $oPerson.Age = Random(18, 99, 1)
            ConsoleWrite('Person''s age => ' & $oPerson.Age & @CRLF)
            $oPerson.IncreaseAge() ; A silly method to show the encapsulation of the object around the Age property.
            ConsoleWrite('Person''s new age => ' & $oPerson.Age & @CRLF)
            ConsoleWrite($oPerson.ToString() & @CRLF) ; Call the ToString() method which was overriden.
        Else
            ConsoleWrite('An error occurred when registering the Dll.' & @CRLF)
        EndIf
    Else
        ConsoleWrite('An error occurred when registering the Dll.' & @CRLF)
    EndIf
    ; The dll is automatically unloaded when the application closes.
EndFunc   ;==>Example

; #FUNCTION# ====================================================================================================================
; Name ..........: _DotNet_Load
; Description ...: Load a .NET compiled dll assembly.
; Syntax ........: _DotNet_Load($sDllPath)
; Parameters ....: $sDllPath            - A .NET compiled dll assembly located in the @ScriptDir directory.
;                  $bAddAsCurrentUser   - [optional] True or false to add to the current user (supresses UAC). Default is False, all users.
; Return values .: Success: True
;                  Failure: False and sets @error to non-zero:
;                       1 = Incorrect filetype aka not a dll.
;                       2 = Dll does not exist in the @ScriptDir location.
;                       3 = .NET RegAsm.exe file not found.
;                       4 = Dll already registered.
;                       5 = Unable to retrieve the GUID for registering as a current user.
; Author ........: guinness
; Remarks .......: With ideas by funkey for running under the current user.
; Example .......: Yes
; ===============================================================================================================================
Func _DotNet_Load($sDllPath, $bAddAsCurrentUser = Default)
    If $bAddAsCurrentUser = Default Then $bAddAsCurrentUser = False
    Local $bReturn = __DotNet_Wrapper($sDllPath, $DOTNET_LOADDLL, $bAddAsCurrentUser)
    Return SetError(@error, @extended, $bReturn)
EndFunc   ;==>_DotNet_Load

; #FUNCTION# ====================================================================================================================
; Name ..........: _DotNet_Unload
; Description ...: Unload a previously registered .NET compiled dll assembly.
; Syntax ........: _DotNet_Unload($sDllPath)
; Parameters ....: $sDllPath            - A .NET compiled dll assembly located in the @ScriptDir directory.
; Return values .: Success: True
;                  Failure: False and sets @error to non-zero:
;                       1 = Incorrect filetype aka not a dll.
;                       2 = Dll does not exist in the @ScriptDir location.
;                       3 = .NET RegAsm.exe file not found.
; Author ........: guinness
; Remarks .......: With ideas by funkey for running under the current user.
; Example .......: Yes
; ===============================================================================================================================
Func _DotNet_Unload($sDllPath)
    Local $bReturn = __DotNet_Wrapper($sDllPath, $DOTNET_UNLOADDLL, Default)
    Return SetError(@error, @extended, $bReturn)
EndFunc   ;==>_DotNet_Unload

; #FUNCTION# ====================================================================================================================
; Name ..........: _DotNet_UnloadAll
; Description ...: Unload all previously registered .NET compiled dll assemblies.
; Syntax ........: _DotNet_UnloadAll()
; Parameters ....: None
; Return values .: Success: True
;                  Failure: False and sets @error to non-zero:
;                       1 = Incorrect filetype aka not a dll.
;                       2 = Dll does not exist in the @ScriptDir location.
;                       3 = .NET RegAsm.exe file not found.
;                       4 = Dll already registered.
;                       5 = Unable to retrieve the GUID for registering as a current user.
; Author ........: guinness
; Remarks .......: With ideas by funkey for running under the current user.
; Example .......: Yes
; ===============================================================================================================================
Func _DotNet_UnloadAll()
    Local $bReturn = __DotNet_Wrapper(Null, $DOTNET_UNLOADDLLALL, Default)
    Return SetError(@error, @extended, $bReturn)
EndFunc   ;==>_DotNet_UnloadAll

; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name ..........: __DotNet_Wrapper
; Description ...: A wrapper for the _DotNet_* functions.
; Syntax ........: __DotNet_Wrapper($sDllPath, $iType)
; Parameters ....: $sDllPath            - A .NET compiled dll assembly located in the @ScriptDir directory.
;                  $iType               - A $DOTNET_* constant.
; Return values .: Success: True
;                  Failure: False and sets @error to non-zero:
;                       1 = Incorrect filetype aka not a dll.
;                       2 = Dll does not exist in the @ScriptDir location.
;                       3 = .NET RegAsm.exe file not found.
;                       4 = Dll already registered.
;                       5 = Unable to retrieve the GUID for registering as current user.
; Author ........: guinness
; Remarks .......: ### DO NOT INVOKE, AS THIS IS A WRAPPER FOR THE ABOVE FUNCTIONS. ###
; Remarks .......: With ideas by funkey for running under the current user.
; Related .......: Thanks to Bugfix for the initial idea: http://www.autoitscript.com/forum/topic/129164-create-a-net-class-and-run-it-as-object-from-your-autoit-script/?p=938459
; Example .......: Yes
; ===============================================================================================================================
Func __DotNet_Wrapper($sDllPath, $iType, $bAddAsCurrentUser)
    Local Static $aDllPaths[Ceiling($DOTNET_PATHS_MAX * 1.3)][$DOTNET_PATHS_MAX] = [[0, 0]], _
            $sRegAsmPath = Null

    If Not ($iType = $DOTNET_UNLOADDLLALL) Then
        If Not (StringRight($sDllPath, StringLen('dll')) == 'dll') Then ; Check the correct filetype was passed.
            Return SetError(1, 0, False) ; Incorrect filetype.
        EndIf

        If Not FileExists($sDllPath) Then ; Check the filepath exists in @ScriptDir.
            Return SetError(2, 0, False) ; Filepath does not exist.
        EndIf
    EndIf

    If $sRegAsmPath == Null Then
        $sRegAsmPath = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework', 'InstallRoot')
        If @error Then
            $sRegAsmPath = '' ; Set to an empty string to acknowledge that searching for the path happened.
        Else
            Local $aFilePaths = _FileListToArray($sRegAsmPath, '*', $FLTA_FOLDERS), _
                    $sNETFolder = ''
            If Not @error Then
                For $i = UBound($aFilePaths) - 1 To 1 Step -1
                    If StringRegExp($aFilePaths[$i], '(?:[vV]4\.0\.\d+)') Then
                        $sNETFolder = $aFilePaths[$i]
                        ExitLoop
                    ElseIf StringRegExp($aFilePaths[$i], '(?:[vV]2\.0\.\d+)') Then
                        $sNETFolder = $aFilePaths[$i]
                        ExitLoop
                    EndIf
                Next
            EndIf
            $sRegAsmPath &= $sNETFolder & '\RegAsm.exe'
            If FileExists($sRegAsmPath) Then
                OnAutoItExitRegister(_DotNet_UnloadAll) ; Register when the AutoIt executable is closed.
            Else
                $sRegAsmPath = '' ; Set to an empty string to acknowledge that searching for the path happened.
            EndIf
        EndIf
    EndIf

    If $sRegAsmPath == '' Then
        Return SetError(3, 0, False) ; .NET Framework 2.0 or 4.0 required.
    EndIf

    Switch $iType
        Case $DOTNET_LOADDLL
            Local $iIndex = -1
            For $i = $DOTNET_PATHS_MAX To $aDllPaths[$DOTNET_PATHS_INDEX][$DOTNET_PATHS_FILEPATH]
                If $sDllPath = $aDllPaths[$i][$DOTNET_PATHS_FILEPATH] Then
                    Return SetError(4, 0, False) ; Dll already registered.
                EndIf
                If $iIndex = -1 And $aDllPaths[$i][$DOTNET_PATHS_FILEPATH] == '' Then
                    $iIndex = $i
                    ExitLoop
                EndIf
            Next

            If $iIndex = -1 Then
                $aDllPaths[$DOTNET_PATHS_INDEX][$DOTNET_PATHS_FILEPATH] += 1
                $iIndex = $aDllPaths[$DOTNET_PATHS_INDEX][$DOTNET_PATHS_FILEPATH]
            EndIf

            Local Const $iUBound = UBound($aDllPaths)
            If $aDllPaths[$DOTNET_PATHS_INDEX][$DOTNET_PATHS_FILEPATH] >= $iUBound Then
                ReDim $aDllPaths[Ceiling($iUBound * 1.3)][$DOTNET_PATHS_MAX]
            EndIf
            $aDllPaths[$iIndex][$DOTNET_PATHS_FILEPATH] = $sDllPath
            $aDllPaths[$iIndex][$DOTNET_PATHS_GUID] = Null

            If $bAddAsCurrentUser Then ; Idea by funkey, with modification by guinness.
                Local $sTempDllPath = @TempDir & '\' & $sDllPath & '.reg'
                If Not (RunWait($sRegAsmPath & ' /s /codebase ' & $sDllPath & ' /regfile:"' & $sTempDllPath & '"', @ScriptDir, @SW_HIDE) = $DOTNET_REGASM_OK) Then
                    Return SetError(5, 0, False) ; Unable to retrieve the GUID for registering as current user.
                EndIf

                Local Const $hFileOpen = FileOpen($sTempDllPath, BitOR($FO_READ, $FO_APPEND))
                If $hFileOpen > -1 Then
                    FileSetPos($hFileOpen, 0, $FILE_BEGIN)
                    Local $sData = FileRead($hFileOpen)
                    If @error Then
                        $aDllPaths[$DOTNET_PATHS_INDEX][$DOTNET_PATHS_FILEPATH] -= 1 ; Decrease the index due to failure.
                        Return SetError(5, 0, False) ; Unable to retrieve the GUID for registering as current user.
                    EndIf

                    $sData = StringReplace($sData, 'HKEY_CLASSES_ROOT', 'HKEY_CURRENT_USER\Software\Classes')
                    FileSetPos($hFileOpen, 0, $FILE_BEGIN)
                    If Not FileWrite($hFileOpen, $sData) Then
                        $aDllPaths[$DOTNET_PATHS_INDEX][$DOTNET_PATHS_FILEPATH] -= 1 ; Decrease the index due to failure.
                        Return SetError(5, 0, False) ; Unable to retrieve the GUID for registering as current user.
                    EndIf
                    FileClose($hFileOpen)

                    Local $aSRE = StringRegExp($sData, '(?:\R@="{([[:xdigit:]\-]{36})}"\R)', $STR_REGEXPARRAYGLOBALMATCH)
                    If @error Then
                        $aDllPaths[$DOTNET_PATHS_INDEX][$DOTNET_PATHS_FILEPATH] -= 1 ; Decrease the index due to failure.
                        Return SetError(5, 0, False) ; Unable to retrieve the GUID for registering as current user.
                    EndIf
                    $aDllPaths[$iIndex][$DOTNET_PATHS_GUID] = $aSRE[0] ; GUID of the registry key.

                    RunWait('reg import "' & $sTempDllPath & '"', @ScriptDir, @SW_HIDE) ; Import to current users' classes
                    FileDelete($sTempDllPath)
                EndIf
            Else
                Return RunWait($sRegAsmPath & ' /codebase ' & $sDllPath, @ScriptDir, @SW_HIDE) = $DOTNET_REGASM_OK ; Register the .NET Dll.
            EndIf

        Case $DOTNET_UNLOADDLL
            For $i = $DOTNET_PATHS_MAX To $aDllPaths[$DOTNET_PATHS_INDEX][$DOTNET_PATHS_FILEPATH]
                If $sDllPath = $aDllPaths[$i][$DOTNET_PATHS_FILEPATH] And Not ($aDllPaths[$i][$DOTNET_PATHS_FILEPATH] == Null) Then
                    Return __DotNet_Unregister($sRegAsmPath, $aDllPaths[$i][$DOTNET_PATHS_FILEPATH], $aDllPaths[$iIndex][$DOTNET_PATHS_GUID])
                EndIf
            Next

        Case $DOTNET_UNLOADDLLALL
            Local $iCount = 0
            If $sDllPath == Null And $aDllPaths[$DOTNET_PATHS_INDEX][$DOTNET_PATHS_FILEPATH] > 0 Then
                For $i = $DOTNET_PATHS_MAX To $aDllPaths[$DOTNET_PATHS_INDEX][$DOTNET_PATHS_FILEPATH]
                    If Not ($aDllPaths[$i][$DOTNET_PATHS_FILEPATH] == Null) Then
                        $iCount += (__DotNet_Unregister($sRegAsmPath, $aDllPaths[$i][$DOTNET_PATHS_FILEPATH], $aDllPaths[$iIndex][$DOTNET_PATHS_GUID]) ? 1 : 0)
                    EndIf
                Next
                $aDllPaths[$DOTNET_PATHS_INDEX][$DOTNET_PATHS_FILEPATH] = 0 ; Reset the count.
                Return $iCount == $aDllPaths[$DOTNET_PATHS_INDEX][$DOTNET_PATHS_FILEPATH]
            EndIf
    EndSwitch

    Return True
EndFunc   ;==>__DotNet_Wrapper

Func __DotNet_Unregister($sRegAsmPath, ByRef $sDllPath, ByRef $sGUID)
    Local $bReturn = RunWait($sRegAsmPath & ' /unregister ' & $sDllPath, @ScriptDir, @SW_HIDE) = $DOTNET_REGASM_OK ; Unregister the .NET Dll.
    If $bReturn Then
        If Not ($sGUID == Null) Then
            RegDelete('HKEY_CURRENT_USER\Software\Classes\CLSID\' & $sGUID) ; 32-bit path.
            RegDelete('HKEY_CLASSES_ROOT\Wow6432Node\CLSID\' & $sGUID) ; 64-bit path.
            $sGUID = Null ; Remove item.
        EndIf
        $sDllPath = Null ; Remove item.
    EndIf
    Return $bReturn
EndFunc   ;==>__DotNet_Unregister

I look forward to the comments and questions people have on this interesting subject, as well as any suggestions of improvement people might have.

The ZIP file contains all related source code for both AutoIt and .NET.

Dot-NET Assembly in AutoIt.zip

Edited by guinness

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

Not a massive problem as the dlls are unregister on application exit, but the Unload() method wasn't unregistering a single dll passed. I have updated the code accordingly. Sorry for any inconvenience caused.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

Thanks for sharing.

It reminded me of this: WinSCP - UDF

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 1/12/2015 at 9:57 AM, guinness said:

The ZIP file contains all related source code for both AutoIt and .NET.

I do not see any zip file in your post.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)
  On 1/12/2015 at 10:46 AM, mLipok said:

Thanks for sharing.

It reminded me of this: WinSCP - UDF

I remembered this after posting, as I checked the WinSCP code to see if they use more than just an empty constructor. Though our examples are slightly different, as yours assumes the assembly is registered and is a precompiled assembly.

  On 1/12/2015 at 10:47 AM, mLipok said:

I do not see any zip file in your post.

I see the ZIP file.

Edited by guinness

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted (edited)

sorry about the zip file , web page was not refreshed :(

edit:

or simply overlooked.

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

  On 1/12/2015 at 10:52 AM, guinness said:

I remembered this after posting, as I checked the WinSCP code to see if they use more than just an empty constructor. Though our examples are slightly different, as yours assumes the assembly is registered and is a precompiled assembly.

I mean that: you reminded me of my unfinished project. I was not going to compare your UDF to mine.

Moreover, I am going to use your UDF in my :)

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Thanks again guinness
This is very good example how to Develop my own .NET  dll, and use them in AutoIt.
Over this once a long time ago I was wondering, it is possible that I will return to this in my work.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

  On 1/12/2015 at 11:29 AM, mLipok said:

Thanks again guinness

This is very good example how to Develop my own .NET  dll, and use them in AutoIt.

Over this once a long time ago I was wondering, it is possible that I will return to this in my work.

You're very welcome. The functions are super simple, it was just a case of merging this information into a single post, as what I have seen on the AutoIt Forum wasn't clear nor did it include the means of how to create a class library.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

I just updated with a huge bug fix. The unloading was poorly written, which unfortunately I don't have any excuse for. Does tiredness count? See the first post with code that has been statically tested.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Hi Guinness,

I did the same this a few years ago when .Net 2.0 was still around.

#RequireAdmin
 
; Framework 2.0
;$vbc = "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\vbc.exe" ;  ; check the path of your version
;$RegAsm = "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe" ; check the path of your version
 
; Framework 4.0
$vbc = "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\vbc.exe" ;  ; check the path of your version
$RegAsm = "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe" ; check the path of your version
 
RunWait($vbc & " /target:library hello.vb", @ScriptDir, @SW_HIDE) ; compile the .net DLL
RunWait($RegAsm & " /codebase hello.dll", @ScriptDir, @SW_HIDE) ; register the .net DLL
 
$obj = ObjCreate("myDotNetLibrary.myDotNetClass")
$obj.myDotNetProperty = " ... from DotNet to the AutoIt World !"
 
MsgBox(0,"My Own DotNet Object " , $obj.myDotNetMethod($obj.myDotNetProperty) & @CRLF)
 
RunWait($RegAsm & " /unregister hello.dll", @ScriptDir, @SW_HIDE) ; unregister the .net DLL

 

Here is the Hello World code. 

Imports System.Collections.Generic
Imports System.Text
Imports System.Runtime.InteropServices
 
Namespace myDotNetLibrary
  <ClassInterface(ClassInterfaceType.AutoDual)> _
  Public Class myDotNetClass
    Private myProperty As String
 
    Public Sub New()
    End Sub
 
    Public Function myDotNetMethod(input As String) As String
      Return "Hello " & input
    End Function
 
    Public Property myDotNetProperty() As String
      Get
        Return myProperty
      End Get
      Set(ByVal value As String)
        myProperty = value
      End Set
    End Property
 
  End Class
End Namespace

Works as well without the COM visible line :)

There is also a possibility to run Assemblies in .Net without registering them in the GAC ! But this takes us too far down the .NET road, and after all this is still a AU3 forum ;)

 

rgds

ptrex

Posted
  On 1/15/2015 at 7:50 PM, ptrex said:

All

Maybe this can help as well  ;) 

'?do=embed' frameborder='0' data-embedContent>>

Totally missed this.

As for your code, thanks. Though maybe it's different in .NET v2.0, as I had to put the ComVisible for it to work.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

Yeah. I want to do some tests as I would like to take my PreExpand project and port across to a C#, as right now it's slow on super large scripts.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

k here i have some results from extract icon's for my prog.

these are the times from start to end building gui

with dll call from guinness  626.965717709932   98% qwality => c#  this is the best option for me

with runwait  4247.32081870741  98% qwality => c#
with autoit  474.510307874325  30% qwality

Posted

Do have code you possible used? Also what is the 30% quality about?

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

Thanks guinness for this functions. I found an issue regarding the error values of the wrapper functions. You have to wrap the main function like this to get error values other than zero in case of an error:

Func _DotNet_Load($sDllPath)
    Local $Result = __DotNet_Wrapper($sDllPath, $DOTNET_LOADDLL)
    Return SetError(@error, @extended, $Result)
EndFunc   ;==>_DotNet_Load

Tested on V3.3.8.1 but behaviour should be the same on newer AutoIt versions.

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Posted
  On 1/15/2015 at 10:01 PM, funkey said:

Thanks guinness for this functions. I found an issue regarding the error values of the wrapper functions. You have to wrap the main function like this to get error values other than zero in case of an error:

Func _DotNet_Load($sDllPath)
    Local $Result = __DotNet_Wrapper($sDllPath, $DOTNET_LOADDLL)
    Return SetError(@error, @extended, $Result)
EndFunc   ;==>_DotNet_Load

Tested on V3.3.8.1 but behaviour should be the same on newer AutoIt versions.

Oh yeah, we had a debate about this in the MVP section on why my approach doesn't work (but I think it should), I will fix the code. Thanks.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

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
×
×
  • Create New...