the kick inside Posted June 23, 2011 Share Posted June 23, 2011 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) Next 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!) Link to comment Share on other sites More sharing options...
JohnOne Posted June 23, 2011 Share Posted June 23, 2011 I may be barking up the wrong tree here so dont take this as fact, but I have read a number of times on the forums that autoit does not have the capability to interact with .Net framework. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
the kick inside Posted June 23, 2011 Author Share Posted June 23, 2011 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 Else 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! Link to comment Share on other sites More sharing options...
the kick inside Posted June 23, 2011 Author Share Posted June 23, 2011 appologies for bumping...seems to be getting buried. Link to comment Share on other sites More sharing options...
xavierh Posted June 23, 2011 Share Posted June 23, 2011 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". Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now