Jump to content
Sign in to follow this  

Attempting to mess with COM objects. I have the DLL but need some help.

Recommended Posts


Here is the link: http://www.yubico.com/develop/open-source-software/low-level-library/

At the bottom right there are download links for the PDF, x86 and x64 API DLL.

User guide (pdf)

Binary installer for 32-bit / x86 (Digitally signed)

Binary installer for 64-bit / x64 (Digitally signed)

I know basically nothing about COM so I am doing what I always do and just messing with it to see if something clicks and goes from "impossible" to "Hmm I think I get it.."

I have attempted to do this so far:

$hYubikey = ObjGet('C:\Program Files\Yubico\Yubikey Client API\Bin\x64\YubiClientAPI.dll')
;~ $hYubikey = ObjGet('C:\Program Files (x86)\Yubico\Yubikey Client API\Bin\x86\YubiClientAPI.dll')
$test = $hYubikey.readSerial('ycCALL_MODE_BLOCKING')

So far it complains: H:\Autoit projects\ewre5thy6jk.au3 (3) : ==> Variable must be of type "Object".:

Here is what the PDF says as an example (I think it is a c# example)

4.5 Serial number read

The non-alterable device serial number can be read (unless disabled in the device

configuration) via an API call.

The call completes in around 50 ms, so generally an asynchronous call is typically not



Property readSerial(ycCALL_MODE mode) As ycRETCODE rc

The basic principle (using blocking calls) is

returnCode = readSerial(ycCALL_MODE_BLOCKING)

if returnCode = ycRETCODE_OK Then

dataEncoding = ycENCODING_UINT32

print dataBuffer -- Response is here as 32-bits integer


print “An ycRETCODE_xx error occurred”


What do you think I need to do to perform a check like this using the provided DLL ? I am basically an idiot when it comes to COM and this is my first introduction to it. As I understand it a COM / DLL is almost like a chunk of functions that can be called over and over by various means. Could be wrong because I have not really looked indepth into it. I would just like a bit of help understanding the basics of what is involved in getting communication going with the API. Edited by Morthawt

Share this post

Link to post
Share on other sites

What you need is a COM error handler. This will give you detailed information why your script failed. See the help file for ObjEvent.

My UDFs and Tutorials:


Active Directory (NEW 2018-12-03 - Version - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki

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