Visual Studio Project Setup



DemoDotNet - A OVDotNetApi Macro GuideThis Guide is to provide users a roadmap in using the OVDotNetApi to automate or add intelligence to your new or existing .NET enabled applications to communicate with OutsideView to your host. In this guide we will also make reference to the OVDotNetApi calls by referring it as ovApi. Table of Contents TOC \o "1-3" \h \z \u Visual Studio Project Setup PAGEREF _Toc35961445 \h 4OVDotNetApi Control PAGEREF _Toc35961446 \h 5Creating Windows Form Project PAGEREF _Toc35961447 \h 7Adding the OVDotNetApi control onto the Form PAGEREF _Toc35961448 \h 7DemoDotNet Project PAGEREF _Toc35961449 \h 10Tabbed Windows PAGEREF _Toc35961450 \h 10Screen Text PAGEREF _Toc35961451 \h 10Data Fields PAGEREF _Toc35961452 \h 10Input Fields PAGEREF _Toc35961453 \h 11Capture Data PAGEREF _Toc35961454 \h 11Capture Log PAGEREF _Toc35961455 \h 11Block Mode Login PAGEREF _Toc35961456 \h 12VI’s testing PAGEREF _Toc35961457 \h 12Send to Host Group Box PAGEREF _Toc35961458 \h 12Send Command Button PAGEREF _Toc35961459 \h 12Send Function Key Button PAGEREF _Toc35961460 \h 12Get Session State Button PAGEREF _Toc35961461 \h 12Send Virtual Key Button PAGEREF _Toc35961462 \h 12Set Mask Button PAGEREF _Toc35961463 \h 13Honor Session Control PAGEREF _Toc35961464 \h 13Request / Release Control Button PAGEREF _Toc35961465 \h 14OV Linked Info Group Box PAGEREF _Toc35961466 \h 14Workspace Name PAGEREF _Toc35961467 \h 14OV Session PAGEREF _Toc35961468 \h 14Capture Data Group Box PAGEREF _Toc35961469 \h 14Enable / Disable Capture Button PAGEREF _Toc35961470 \h 15Accumulate Data Check Box PAGEREF _Toc35961471 \h 15Gui Setting Group Box PAGEREF _Toc35961472 \h 15Normal Gui Button PAGEREF _Toc35961473 \h 15Minimal GUI Button PAGEREF _Toc35961474 \h 15Simple GUI Button PAGEREF _Toc35961475 \h Environment Group Box PAGEREF _Toc35961476 \h Version Running Button PAGEREF _Toc35961477 \h 17Session Group Box PAGEREF _Toc35961478 \h 17Visualize Screen Button PAGEREF _Toc35961479 \h 17Clear Text Button PAGEREF _Toc35961480 \h 18Start OV Button PAGEREF _Toc35961481 \h 18Terminate OV Button PAGEREF _Toc35961482 \h 18Attach to OV Button PAGEREF _Toc35961483 \h 18Shutdown OV Button PAGEREF _Toc35961484 \h 18OV Scan PAGEREF _Toc35961485 \h 19Enter OV Addr PAGEREF _Toc35961486 \h 19Get OVAPI Version PAGEREF _Toc35961487 \h 19Window Handle Group Box PAGEREF _Toc35961488 \h 20Linked OV Win Handle Button PAGEREF _Toc35961489 \h 20OV Win Handles Button PAGEREF _Toc35961490 \h 20Linked Session Handle Button PAGEREF _Toc35961491 \h 20Session Handles Button PAGEREF _Toc35961492 \h 20Auto Trim Host Fields Group Box PAGEREF _Toc35961493 \h 20Various Tests PAGEREF _Toc35961494 \h 21SetCursor PAGEREF _Toc35961495 \h 21GetOSInfo PAGEREF _Toc35961496 \h 21IXF Test PAGEREF _Toc35961497 \h 21List File Transfer Setting PAGEREF _Toc35961498 \h 22IO Testing PAGEREF _Toc35961499 \h 22IO Trigger PAGEREF _Toc35961500 \h 22IO Query PAGEREF _Toc35961501 \h 22IO TypeSet PAGEREF _Toc35961502 \h 22IO Set PAGEREF _Toc35961503 \h 22Wrap-up PAGEREF _Toc35961504 \h 22Troubleshoot Updating OVDotNetApi Reference PAGEREF _Toc35961505 \h 23Visual Studio Project SetupNote: This step already assumes you have Visual Studio 2015 and .NET Framework 4.5.1 installed on your system. If not, then please install those items before continuing on with these steps.The DemoDotNet Project is a good place to tinker around to learn about the OVDotNetApi. However, it does not show how to setup a Windows Forms project to use the OVDotNetApi. This section will provide steps on how to get the OVDotNetApi Control installed into your Visual Studio toolbox so that it can be used when you are developing a OVDotNet Macro:OVDotNetApi ControlThe OVDotNetApi control installer is located in the OutsideView Installation image’s Setup folder:In that folder double click on the OVDotNetApi.vsix installer and that will launch the VSIX installation program to install the OVDotNetApi control:Click the Install button to install the control into your Visual Studio that is detected by the installer. After you are finished with the Installation program, you will need to restart Visual Studio if it was already up and running.The installation installs the OVDotNetApi control into your profile such that it is in the Extensions folder:For those of you who already have an older version of the OVDotNetapi control installed in your Visual Studio:In Visual Studio ToolBox, locate the OVDotNetApi tab section and select it and right click mouse button to delete the tab: 2. Next navigate with the File Explorer to the Visual Studio extensions folder located in your profile: C:\Users\YOUR_PROFILE\AppData\Local\Microsoft\VisualStudio\14.0\Extensions --you will see folder names that look randomly such as “adfhf0cs.pue”. Open that folder to verify that it contains the OVDotNetApi.dll. If it does then you found the correct folder and you can delete that folder. Finally run the Installer to the newer version of the OVDotNetApi installer.Creating Windows Form ProjectIn Visual Studio click on the menu File New Project… and launch the New project dialog. Select templates Visual C# and then Windows Form Application. You should see an image like below:Name the project something meaningful to you and then click on the OK button.Adding the OVDotNetApi control onto the FormIn your Windows Application project, select Form1.cs so that the design page is displayed:Next click on the Toolbox and look for the OVdotNetApi tab section:Select the OVDotNetApi control and drag it onto your Form1 design page. It should look something like this:You can Rename the ovDotNetApi1 control name variable to something easier such as ovApi in your code for easier reference. After understanding how to setup a project for use with OVDotNetapi, you can take a look at the DemoDotNet project and the explanations below as a starting point to develop your own macro.DemoDotNet ProjectThis section will talk bout the project and describe the various UI Element on the Form page. It is helpful to have that project opened as you read the content below.Tabbed WindowsThe Tabbed Windows contains different windows to display information using the various features of the OVDotNetApi.Screen TextThe Screen Text contains the information shown on the linked OutsideView session screen. This screen is used with the functionality in the Send to Host Group Box. Data FieldsThe Data Fields tabbed window shows all the data fields displayed on a block mode screen of a hot linked OutsideView session. This window uses a DataGridView object configured with its DataSource set to a BindingSource pointing to OvDotNet.OvFieldInfo.Input FieldsThe Input Fields tabbed window provides an example of how to show all the input fields displayed on a block mode screen of a hot linked OutsideView session. This window uses a DataGridView object configured with its DataSource set to a BindingSource pointing to OvDotNet.OvInputField. Users can input data into this DataGridView table and it will be updated onto the OutsideView linked session screen.Capture DataThe Capture Data tabbed window contains the value of the last host write to the terminal emulation. The Capture Data Tabbed Window is used with the Capture Data Group Box.Capture LogThe Capture Log tabbed window contains a log of all transactions that have occurred between the client and the host since the Enable Capture button has been clicked. This tabbed window is used with the Capture Data Group Box.Block Mode LoginThis tab provides an example using the text field values for account and password to set the ovApi.InputFields array’s first two fields to log into a block mode application. Note that this assumes your block mode screen has the first two input field as user id and password. Otherwise you will need to modify the InputFields’ array reference.VI’s testingThis panel is used for internal testing and to be disregarded. You could also put your own testing here.Send to Host Group BoxThis group box provides an example of using the OVDotNetApi’s features in a macro that transmits data to the host.Send Command ButtonThis button uses the ovApi.Text to send command to the host. Type the command in the text box labeled Command and either push the Enter key or click on the Send Command button to send the command to the host.Send Function Key ButtonThis button takes the Function Key selected in the Function Key drop down list (Tandem Function Keys) box and sends it to the host. It uses ovApi.EmitFunctionKey call to send the function key.Get Session State ButtonThis button gets the current host linked session state by using ovApi.CurrentSessionState. The information retrieved is displayed in the Events Received section of the Demo Form. The possible values for CurrentSessionState are mapped to the OvSessionState enum object. These possible values are: Online = 0, Connecting = 1, ConnectFailed = 2, Disconnected = 3, Terminated = 4, FailedLinkage = 5, and MacrosNotAllowed = 6. Send Virtual Key ButtonThis button sends the keystroke(s) to the linked terminal session as if the user typed it on the keyboard. It uses ovApi.EmitVirtualKey call to send the virtual key. Place the cursor into the Virtual Key text field and then type the key or keys you want to send to the host. Click on the Send VirtualKey button to simulate as if the keys were pressed from the keyboard. Note that in DemoDotNet, it is configured to launch Notepad if user presses F3 key within OutsideView or sends the F3 keypress from the virtual key button.Set Mask ButtonThis button sets the applied mask from the Fkey Press Event Mask drop down list option for use with Event Flow Control. The possible masks are:Member nameValueDescriptionNone0All events are temporally turned off. NumPad1Generate events for numpad keys Tab2Generate events for tab key CursorMovement4Generate events for cursor movement EnterKey8Generate events for enter key F_Keys16Generate events for Function keys Fxx PageMovement32Generate events for page movement keys Editing64Generate events for Editing keys AlphaNumeric128Generate events for AlphaNumeric ctrl or alt keys OtherPunctionation256Generate events for other punctionation ctrl or alt keys Miscellaneous512Generate events for Miscellaneous keys AllKeys1023Generate events for all keys Default1019Generate default events for all keys except cursor movement This mask is used in conjunction with FunctionKeyPressed event. The FunctionKey event mask filters which types of function keys trigger the FunctionKeyPress Event. Within the FunctionKeyPress handler you can then capture the specific user input events to perform custom action. When using the FunctionKeyPress event, you will need to use ovApi.FunctionKeyPressedDone function to signal to OutsideView to resume processing characters after your custom action has been completed. In DemoDotNet the registered ovApi_FunctionKeyPressed event handler is set to listen for a F3 key press from OutsideView (Press F3 key from within OutsideView session). The F3 is configured to launch the Notepad application on a background thread in which some text are written onto the notepad text file.Honor Session ControlSession control is for scenarios when you have multiple .NET applications using the OVDotNetApi to communicate to the same OV session. The Session control prevents one .NET application from interrupting the other .net application when processing a series of commands or action. When a .NET application has requested control of OutsideView session, the OutsideView application for that specific session is modified such that the Dynamic Tool Bar, Function Key Tool Bar, and some Menu Tool Bar icons are greyed out:The keyboard is also locked to prevent user input directly from the OutsideView session. In addition to this, other .NET application hot linked to the same session will get locked out and they will not receive any event notifications until the control is released. Note if you find that the OV session is still locked out even after disconnecting the hotlink from your macro, you can unlock the OV keyboard by typing this key combination: “ctrl + Alt + u”The above key combination will unlock the OV session and you can start using the keyboard for input.Request / Release Control Button enables coordination of cooperative control between multiple automation users attached to the same emulation session through ovApi.RequestControl api call.OV Linked Info Group BoxThis group box shows the name of the workspace and session that this .NET application is linked to on OutsideView.Workspace NameThe name of the workspace that is currently open in OutsideView.OV SessionThe name of the session that the .NET application is linked to on OutsideView.Capture Data Group BoxThis group box shows an example of using the OVDotNetApi’s Capture Data ability.Enable / Disable Capture Button Turns on/off the ability to capture data within the ovApi.DataCaptureEnable api. This amounts to capturing the text sent to the host and the response from the host. The data is displayed in the tabbed windows for Capture Data and Capture Log.Accumulate Data Check Box This option allows the captured data packets to accumulate in the Capture Data tabbed window screen.Gui Setting Group BoxThe GUI Setting Group Box uses the ovApi.ApplicationRequest to control how you want OutsideView to be displayed.Normal Gui ButtonNormal Gui Button passes the string “NormalGUI” through the ovApi.ApplicationRequest call so that OutsideView is displayed in the normal fashion with the menu bars and buttons:Minimal GUI ButtonMinimal Gui Button passes the string “MinimalGUI” through the ovApi.ApplicationRequest call so that OutsideView is displayed with just the screen and no menu bars, no tool bars, and no buttons:Simple GUI ButtonSimple Gui Button passes the string “SimpleGUI” through the ovApi.ApplicationRequest call so that OutsideView is displayed with just the screen and a tool bar:.NET Environment Group BoxThis group box is used to check the .Net version that is running on your system..Net Version Running ButtonThis button prints out the version of the .NET Framework currently running on your system and is displayed in the Events Received panel.Session Group BoxThe session group box provides functions that are used to link the .NET macro application to OutsideView, launch OutsideView, and other functions not found in a group setting. Visualize Screen ButtonThe Visualize Screen Button is used to launch OutsideView’s Visualize Screen Layout window. The Visualize Screen Layout is used for creating new contexts within OutsideView’s Context Recognition technology. Clear Text ButtonThe Clear Text Button provides a simple means of cleaning off all the text from this Demo’s screen. This is not an ovApi function!Start OV ButtonThe Start OV Button provides an example to launch the OutsideView application with a specified session and hotlinks to that session using ovApi.HotLinkToOV. In this macro example it is launching a session named s72k.cps file. You will need to create this session or use an existing session file in OutsideView in order for the Start OV Button feature to work.Terminate OV ButtonThe Terminate OV Button provides an example on how to cut the hotlink connection with OutsideView using ovApi.Terminate. OutsideView will still be up and running but now the .NET macro is no longer linked to OutsideView.Attach to OV ButtonThe Attach to OV Button provides an example on how to establish a link to the current active session in OutsideView. It demonstrates how to use ovApi.HotLinkToOV with handles to link to the current active OutsideView session.Shutdown OV ButtonThe Shutdown OV Button provides an example on how to shutdown OutsideView. It uses ovApi.ShutDown and ovApi.Terminate. OutsideView is closed upon this button getting clicked.OV ScanThe OV Scan Button provides an example of using a Windows Form (EnterOVToLinkToo.cs) to “scan” OutsideView to see what sessions are available to hotlink with. Users can select a session and then click on the OK button. The Demo application will then hotlink to that specific session.Enter OV AddrThe Enter OV Addr button provides an example using a simple form to enter a Window handle and Session Window handle to hotlink with. The Demo application will then establish a link with OutsideView and that specific session. Use the information retrieved from the Window Handle Group Box to get the OV Window and Session handles.Get OVAPI VersionThis function uses ovApi.ApplicationRequest to get the OutsideView version number which should also be the same version number for the OVDotNetApi used in OutsideView. It is preferred to use the same major version number i.e 9.0 for your OVDotNetApi development of your macros. It is not recommended to use OVDotNetApi version 8.2 in your macro and hotlink it to OutsideView 9.0.Window Handle Group BoxThe Window Handle Group Box provides functionality to get the handles to OutsideView and its sessions.Linked OV Win Handle ButtonThis button displays the handle information for the current active linked OutsideView application. It uses the ovApi.OvWindowHandle api call to get the handle.OV Win Handles ButtonThis button provides an example on how you can get the handles for the multiple instances of OutsideView. It returns the list of handles associated with the matching number of running OutsideView application.Linked Session Handle ButtonThis button provides an example of getting the handle that the Demo is currently linked with in OutsideView. It uses the ovApi.TerminalWindowHandle api call to get the linked handle.Session Handles ButtonThis button retrieves all the session handles associated with each running instance of OutsideView application. It uses the ovApi.OvWindowHandles to retrieve the various running instances of OutsideView and then it uses ovApi.TerminalWindowHandles to retrieve the various sessions that are running within the OutsideView application.Auto Trim Host Fields Group BoxThe Auto Trim Host Fields Group Box provides white space trimming mode for text property of Host FieldInfo or OvInputField objects. This optional behavior can be enabled and may be desired if using data binding to the FieldInfo or OVInputField collection properties. These group of radio buttons in this section are used in this Demo application with the Input Fields Tabbed Window and Data Fields Tabbed Window. The Auto Trim Host Fields uses the ovApi.AutoTrimHostFields api with the following OvFieldTextTrimming values:Various TestsThis group box area is a place to create buttons to prototype your future tests/features of the OVDotNetApi macro.SetCursorSimple example of using the ovApi to set the cursor position on OV and then displaying ‘1’ on the new cursor position.GetOSInfoSimple function to check if the macro is running on a Windows Server OS. IXF TestOVDotNetApi support for IXF transfer is limited to the usage of the CommBasic api. This example provides a rough outline of how to perform an IXF file transfer through OVDotNetApi using FileTransferTypeSet, FileTransferSet, FileTransferTrigger, and FileTransferQuery which are based on the CommBasic api calls FtTypeSet$, FtSet$, FtQuery$ and FtTrigger$. Note that this information can be found in the Visual CommBasic for OutsideView documentation from the OV Help-> Visual CommBasic Reference menu.The premise for this test requires that c:\\temp\\linetest.txt to be present on your local PC in order for the file to be transmitted to the host.List File Transfer SettingDisplays the possible File Transfer Settings. Note that this information can be found in the Visual CommBasic for OutsideView documentation from the OV Help-> Visual CommBasic Reference menu and then lookup FtQuery$.IO TestingThese group of functions provide basic function compatibility with the VisualComm Basic macro in the advent that you are not able to provide similar functionality using the OVDotNetApi. More information on these functions can be found in the Visual CommBasic for OutsideView documentation from the OV Help-> Visual CommBasic Reference menu. Lookup IoTrigger$, IoQuery$, IoTypeSet$ and IoSet$.IO TriggerInvokes the change to the I/O settings specified by the IO Set function.IO QueryQueries the current I/O settings.IO TypeSetSpecify the I/O type (Async, SSH, TCP/IP). IO SetPrepares an I/O setting to be changed. The change goes into effect when an Io Trigger("CONNECT") function is executedWrap-up This demo application provides a basic guidance of the features available to use within the OVDotNetApi to communicate with OutsideView. For more detailed description of the api functions you can access the OVDotNetApi Help document from OutsideView: The idea here is that you can work backwards from this project and see how things are hooked up from the ovApi control properties in the project:As a tip, when processing interactions between OutsideView and the Host, you can detect when the keyboard is unlocked to assume the interaction between the host and OutsideView has finished and thus it is OK for your Macro application to start processing the information on your end.Troubleshoot Updating OVDotNetApi ReferenceIf for some reason the DemoForm.cs design page does not come up and shows an error it could be due to an incompatible OVDotNetApi.dll referenced from the project.What you can do is first delete the extensions from your Visual Studio tool box and also from the Visual Studio (C:\Users\user\AppData\Local\Microsoft\VisualStudio\15.0_4e2b7303\Extensions\k3zqwfkc.e4t).Next from the installation image locate the Setup folder and find the OVDotNetApiInstaller folder. Navigate into the VS2012-VS2017 directory and click on the OVDotNetApi.vsix installer to install the OV9.0 OVDotNetApi control into your Visual Studio IDE’s tool box.Now go to the DemoDotNet project that you downloaded and navigate to the DemoDotNet2015.csproj to launch the IDE and create a solution for this project. If you navigate to the DemoForm.cs Design file you will notice that the designer doesn’t seem to come up. What we need to do is update the references for OvDotNetApi.First go to the references and delete the NTrace and OVDotNetApi references in the Solution Explorer. Now Add the reference back to OVDotNetApi: Browse to the location of the OVDotNetApi.dll that was installed from the OVDotNetApi installer that installed the extension into the VS toolbox:C:\Users\YOUR_PROFILE\AppData\Local\Microsoft\VisualStudio\14.0\ExtensionsNote that you will need to search the folder within the extensions area to find the one for OVDotNetApi. Also the VisualStudio version is dependent on the version of visual studio you are using.The DemoForm.cs file should now load correctly in you designer:You should also double check that the project is configured to target .NET Framework 4.5 as that is what the new OVDotNetApi from OV9.0 is targeted against. ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download