0

Attachmate の Reflection for IBM 2014 用の外部アプリケーションを作成しています。そのアプリケーションでは、既存のセッション ファイルを使用して反射アプリケーションを作成しようとしています。アプリケーションは正常に作成されていますが、ユーザーには表示されません。それを行う方法をいくつか試しましたが、まだうまくいきませんでした。

誰かがこれを行った場合、または端末を表示するために何をする必要があるかを知っている場合は、返信してください。

以下は、私がそうするために使用しているコードの一部です。

using Attachmate.Reflection;
using Attachmate.Reflection.Framework;
using Attachmate.Reflection.Emulation.IbmHosts;
using Attachmate.Reflection.UserControl.IbmHosts;
using Attachmate.Reflection.UserInterface;

Application reflectionApplication;
reflectionApplication = MyReflection.CreateApplication("app", true);
IIbmTerminal terminal =(IIbmTerminal)reflectionApplication.CreateControl(@"C:\mypath\test.rd3x");

reflectionApplication = MyReflection.ActiveApplication;
IFrame frame = (IFrame) reflectionApplication.GetObject("Frame");
frame.Visible = true;
4

1 に答える 1

0

これを行う最善の方法は、既存のセッション ファイル (通常は Reflection 内でロードする) を利用することです。このようにして、ホスト名、コード経由のポートについて心配する必要はありません。

これは、私がうまく使用してきた定型文です。

Attachmate.Reflection.Framework.Application reflectionApplication = null;

reflectionApplication = MyReflection.CreateApplication("myWorkspace", true);
if (reflectionApplication != null)
{
    IIbmTerminal terminal = (IIbmTerminal)reflectionApplication.CreateControl(
        @"C:\ProgramData\Attachmate\Reflection\<your session file>.rd3x");
    if (terminal != null)
    {
        terminal.Connect();
        //You can also use AfterConnect event to wait for the connection.
        while (!terminal.IsConnected)
        {
            System.Threading.Thread.Sleep(500);
        }

        IView sessionView;
        IFrame theFrame = (IFrame)reflectionApplication.GetObject("Frame");
        sessionView = theFrame.CreateView(terminal);

        IIbmScreen screen = terminal.Screen;
        screen.WaitForHostSettle(6000, 3000);
    }
    else
        Console.WriteLine("Can not create the control.");
}
else
    Console.WriteLine("Failed to get Application object.");
于 2016-01-13T03:21:05.440 に答える