Hi Gowrisankar,
there several approaches for automating your Host access with RUMBA
1. VBA-Addon for RUMBA (RUMBA 9.5 and later)
With the VBA-Addon for RUMBA you can automate RUMBA from third party Applications without the need to embed the RUMBA Control.
Code snippet:
Sub Main()
Dim app As RumbaApplicationObject
Dim session As RumbaEmulationSessionObject
Dim status As BooleanSet app = GetObject("", "MicroFocus.Rumba")
Set session = app.GetSessionByName("Mainframe Display")
status = session.Connected
If (status = False) Then
session.Connect
ElseIf (status = True) Then
MsgBox ("Rumba is connected")
End If
End Sub
2. The ActiveX approach ( Any Rumba version)
You can embed the RUMBA control in your Application e.g in Excel 32bit and start the automation
Code snippet: (Excel VBA)
....
Set wrkSheet = Worksheets(1)
Set MFDsp = MFForm.Dsp1
MFForm.Dsp1.HostInterface.Name = "WallData.TN3270Link"
MFForm.Dsp1.HostInterface.Interface.InsertName2 "your Host IP"
MFForm.Dsp1.HostInterface.StartupModelType = 2
lRC = MFForm.Dsp1.RDE_Connect_Hsynch(True, 2, 10000, "", 0, 0)
3. RDE.NET (Rumba 8.x and newer)
Open Visual Studio IDE
Create a new C# Windows Forms Application by choosing File > New > Project > Other Languages > Visual C# > Windows Forms Application.
Open the Visual Studio Toolbox tab.
From the Micro Focus RDE group, drag and drop MFDisplayControl into the form. You can adjust its size if you want.
Important: In the Solution Explorer window two new references are automatically added to your project, MFDisplay.Control and Microfocus.RDE.Framework.
These are the RDE. NET references, so do not delete them. Add a button to the form from the tool box, for example:
Double-click on the button and add the following code into the button1_Click method:
private void button1_Click(object sender, EventArgs e)
{
mfDisplayControl1.IRDEDisplay.IRDEConnection.ConnectToDemoHost();
}
Run the application and click button1. You will be connected to Mainframe Demo Host.
4. EHLLAPI or WinHLLAPI
Emulator High Level Language API (EHLLAPI): This interface provides
functions to access emulator "presentation space" data such as characters on the
host screen. It also provides functions for sending keystrokes to the host,
intercepting user-entered keystrokes, querying the status of the host session,
uploading and downloading files, and other functions.
Declare Function hllapi Lib "E:\\Micro Focus\\RUMBA\\System\\ehlapi32.Dll" (Func As integer, ByVal Buffer as String, bSize as Integer, RetC as Integer) As Long
Declare Function GetCurrentTime Lib "kernel32" Alias "GetTickCount" () As Long
Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)
Sub Main()
Dim Astr As String
Dim Alen As Integer
Dim RetC as Integer
Dim Func As Integer
'QuerySessions
Func = 10
AStr = Space(48)
ALen = 48
hllapi Func, Astr, Alen, RetC
Msgbox "The following sessions are open: " & Chr$(10) & Mid$(Astr, 1, 1) & Chr$(10) _
& Mid$(Astr, 13, 1) _
& Chr$(10) & Mid$(Astr, 25, 1) _
'Connect PS
Func = 1 ' connect PS
Astr = "C"
Alen = Len(Astr)
hllapi Func, Astr, Alen, RetC
Msgbox RetC & Chr$(10) & Mid$(Astr, 37, 1)
Func = 2 ' disconnect PS
Astr = ""
Alen = Len(Astr)
hllapi Func, Astr, Alen, RetC
End Sub
5. RUMBA Scripts / Macro (any version)
RUMBA provides a powerful Macro and Scripting Engine
It allows you to write scripts that interact with the host and the local environment, such as data from a spreadsheet, text file, database, etc.
Many of the command require that a profile be set up in advance of using the command
You can find different code samples in you RUMBA installation when you install ScriptEngine.msp.
Hope this helps you to get a general overview about your options.
andree