How to automate Microfocus Rumba using VB.Net

825 views Asked by At

I'm trying to automate Microfocus Rumba application through VB.Net. Due to some constraints, I can't use any of the macros/scripts features that are inbuilt in Rumba.

I came to know that ehlapi32.dll can be used to automate Rumba but I couldn't add ehlapi32.dll or WHLLAPI.dll as references to the .Net solution.

I couldn't create objects of "Microfocus.Rumba"/"Rumba.System"/"Rumba.Application" because of the error "Cannot create Activex component". I tried to resolve it by registering the dll using RegAsm.exe. But it says the Dll is not a valid .net assembly.

I've attached the error snapshots.

Error while adding the dlls in References section of the .Net solution

Cannot create ActiveX component error

Not a valid .Net assembly error

Note : I'm using MicroFocus Rumba Desktop 9.4.1

Any guidance is deeply appreciated.

Thanks.

1

There are 1 answers

5
MarkL On

WHLLAPI.DLL and EHLAPI32.dll are not an ActiveX com component (thus you can't register it with regsvr32, nor create a com interop to it by registering it with regasm), and it's not a .net assembly (thus you can't simply add a reference to it). It's just an 'old fashioned' call library. You need to declare it, then you can make calls to it (via P/Invoke, to be technical).

Something like (the simplest version):

Declare Sub hllapi Lib "EHLAPI32.dll" (lpwFunction As Int32, ByVal lpbyString As String, lpwLength As Int32, lpwReturnCode As Int32)

Then call it

Dim status as Int32
Call hllapi(1, "A", 1, status)    ' Connect to Presentation Space A

You'll need to reference the HLLAPI documentation, multiple versions/instances of that documentation is available online, with examples (and it's mostly standard across vendors). One is https://docs.attachmate.com/extra/x-treme/apis/ehllapi.pdf