Jump to content
Sign in to follow this  
the kick inside

DLL Property Enumeration

Recommended Posts

I need to use some routines from a dll (registered .net assembly), the methods I can access with no issues.

However I need to use some enumerated properties and thats the issue. The dll is written in .Net and has no application method/property.

For instance code like this (mercileessly ripped out of another post!)

$oObj = ObjCreate('excel.applcation') 
$oTLA = ObjCreate("TLI.TLIApplication")
$objInterface = $oTLA.InterfaceInfoFromObject($oObj)
$oMembers = $objInterface.Members
For $member In $oMembers
    ConsoleWrite($member.Name & @CRLF)

Works a treat (for Excel), but I can't point it at the installed .net assembly without getting errors on the object as its simply doesnt have an application class. when I do I get an object error on the line

$oTLA = ObjCreate("TLI.TLIApplication")

Anyone 'been there, done that' - I guess it must be possible as you can accesss the enumarated variables in VB.

Thanks (in advance!)

Share this post

Link to post
Share on other sites

Thanks for the feedback.

I am not a .net programmer (or a vb programmer come to that!) so I also maybe about to bark in the wrong abouretum but as I understand it although this DLL is built in .net and uses the framework thats a bit of a side show (after all I can use various methods from it just fine and you can access it from VB).

The issue comes where I want to call a method using an enumarated value as a paramter...and example of the vb code for what I am trying to achieve is:-

'check to see if the feature is licensed

    If dllobject.FeatureLicensed(dllobject.LicensedFeatures_EnhancedDisplay) Then

        IsFireListLicensed = True


        IsFireListLicensed = False

    End If

dllobject.LicensedFeatures_EnhancedDisplay is enumerated to a value in the dll (lets say 10). In AutoIT if I call the dllobject.featureelicensed(10) works, but ideally i would like to use the enumarated properties in case they change (quite likely) so ideally i would like to use something like dllobject.featureelicensed(dllobject.LicensedFeatures_EnhancedDisplay).

99% of the way there, just failing on the last 1% - isnt that always the way!

Share this post

Link to post
Share on other sites

I don't know if that would resolve anything, but in .net, you can choose to build your dll so that it is visible to COM. If you don't select that option, then your assembly will definitely not be visible from autoit.

In Vis Studion 2010 for C#, it's under Project>Properties. This brings up a window with vertical tabs. Under the Application tab, there is a button, Assembly Information. When you click on that button, the Assembly Information window is displayed and there is a checkbox at the bottom, "Make assembly COM-Visible".

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...