I’m very pleased to announce the availability of BlinkStick Interop COM API for Windows. This API allows access to BlinkStick devices from any programming language on Microsoft Windows that supports COM interoperability. One of those languages is Visual Basic and Visual Basic for Applications. It means that now you can directly control BlinkStick from Microsoft Office products like Word, Excel, PowerPoint and Access, but not limited to those applications only.
Basic usage in Visual Basic
Add reference to BlinkStickInterop.
' The finder class looks for BlinkStick devices and returns reference to them
Dim finder As New BlinkStickFinder
' Variable to store reference to the device
Dim led As BlinkStick
' Find first BlinkStick on OS
Set led = finder.FindFirst()
If led Is Nothing Then
MsgBox "BlinkStick not found!"
Else
Call led.SetColor(0, 255, 0) ' Set the color of the LED to green
End If
This library is only useful for classic Visual Basic. If you want to use BlinkStick with VB.NET, just use the BlinkStickDotNet library available here:
Download the ZIP archive, open the solution file and compile. There are examples in C# with references to the assemblies and you should be able to easily convert the code to VB.NET. If you need any further assistance, just let me know and I will be happy to help.
Hello,
I seem to get an error when using another programming language - in this case Agilent VEE.
It has given me an error when I try to use the COM library:-
Failed to obtain a .Net interop assembly for the COM type library:
To use a COM type library as an .NET assembly, VEE needs to locate either a Primary Interop assembly or locate/generate an interop assembly for the COM library.
This error occurs either when the primary interop assembly is registered incorrectly or when there is an error during the generate of the interop assembly.
You may generate the interop assembly yourself and then use the Browse button in the .NET Assembly References dialog.
To generate the interop assembly yourself, see documentation on “TlbImp” in Microsoft Developer’s Network.
Unable to load the type library 'C:\Program Files (x86)\BlinkStick Interop\BlinkStickInterop.tlb".
I am not so good with understanding all this interop “stuff”. Is there something a bit limiting with respect to the COM?
If I am to use a COM dll, is it possible to obtain the “.h” header file ?
Hi,
im having issues with the COM control and VB6
ive referenced the TLB file as VB6 automatically picked it up and was in the list BUT
every time i try to do anything i keep getting Run-time error ‘-2146234304 (80131040)’ Automation Error
on the finder.FindFirst line
im using the very simple basic code from the github wiki
ive tried running my vb6.exe as admin and without admin
any help would be amazing!
Regards
Simon