Sign in to follow this  
Followers 0
ThanhBT

Call function in class of DLL

3 posts in this topic

#1 ·  Posted (edited)

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



Anyone can help me plz?

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