Sign in to follow this  
Followers 0
water

Visual Basic TypeName function in AutoIt

5 posts in this topic

Visual Basic has the TypeName function to return data-type information about a variable.

For a "simple" variable AutoIts "VarGetType" returns the same result.

But when TypeName returns the name of a reference type such as a class, VarGetType just returns "Object".

For example, if VarName points to an object of class System.Drawing.Printing.PaperSource, TypeName returns "PaperSource".

Is it possible to get "PaperSource" using an AutoIt function?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites



Could be way off the mark here, but it wont be the first time.

$oScriptingDictionary = ObjCreate('scripting.dictionary')
$VarGetType = VarGetType($oScriptingDictionary)
If IsObj($oScriptingDictionary) Then
$Name = ObjName($oScriptingDictionary,1)
MsgBox(0,0,$Name)
EndIf

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

Hi JohnOne,

right on the mark!

ObjName is exactly what I was looking for!

Thanks a bunch!


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Hi Water

I was hoping you could enlighten me on how were you able to create an object for "System.Drawing.Printing.PaperSource"? I cannot seem to figure it out. It doesnt seem like "System.Drawing.Printing" is COM visible.

Share this post


Link to post
Share on other sites

I can't remember where I got the "System.Drawing.Printing.PaperSource" thing from. But as I was talking about Visual Basic in my first post it looks like I found it by Google.

I don't know which problem I needed to solve but I'm sure "System.Drawing.Printing.PaperSource" didn't help.

On this forum is only one similar - but there isn't a solution as well.

It looks like this class is only available for .Net applications.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

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