Jump to content

Call function in class of DLL


ThanhBT
 Share

Recommended Posts

I have custom file Utilities.dll and need to call function GetNumber() in that file.

But GetNumber is member of class Utilities and Utilities is member of namespace Utilities.

In .Net i using that code

Utilities.Utilities number = new Utilities.Utilities();
strNumber = number.GetNumber(strFilePath);

I don't know how to call GetNumber() in my custom DLL with autoit

Sorry for my English. Thanks a lot.

Edited by ThanhBT
Link to comment
Share on other sites

  • 3 weeks later...

Your Utilities.dll written in .NET?

I'm not sure but first of all try to register your dll with regasm.exe with /codebase or /tlb option

and then use ObjCreate in AutoIt

Eample (NOT TESTED!)

$strFilePath = "blah blah blah"
$oUtil = ObjCreate("Utilities.Utilities")
If not @error then
    ;Msgbox(0,"ObjCreate Test","Object created successful!")
    $strNumber = $oUtil.GetNumber($strFilePath)
    Msgbox(0,"ObjCreate Test",$strNumber)
Else
    Msgbox(16,"ObjCreate Test","Failed to create Object. Error code: " & hex(@error,8))
Endif
$oUtil = 0
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...