Jump to content
Sign in to follow this  

Call function in class of DLL

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

Share this post

Link to post
Share on other sites

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)
    Msgbox(16,"ObjCreate Test","Failed to create Object. Error code: " & hex(@error,8))
$oUtil = 0

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...