1

ここにある手順とここにあるドキュメントとここにあるドキュメントに基づいて、画面共有アプリケーションを作成しようとしています。ただし、これはあまり情報が存在しないトピックであり、ドキュメントも非常にまばらです。

これが私が取り組んでいるコードのスニペットです。これは私のセッション (サーバー) 側にあるため、デスクトップをクライアントと共有する側です。

private void Form1_Load(object sender, EventArgs e)
    {
        session.OnAttendeeConnected += session_OnAttendeeConnected;
        session.Open();

        IRDPSRAPIInvitation invitation = session.Invitations.CreateInvitation(null, "test", "", 10);
        invitationTextBox.Text = invitation.ConnectionString;
        log.Debug("Created invitation: " + invitation.ConnectionString);
    }

    void session_OnAttendeeConnected(object pAttendee)
    {
        IRDPSRAPIAttendee attendee = pAttendee as IRDPSRAPIAttendee;
        attendee.ControlLevel = CTRL_LEVEL.CTRL_LEVEL_INTERACTIVE;
        log.Info("Attendee Connected from " + attendee.RemoteName);
    }

    private void requestColourDepth(object sender, EventArgs e)
    {
        session.Pause();

        if (eightBitRadio.Checked)
        {
            session.colordepth = 8;
        }
        else if (sixteenBitRadio.Checked)
        {
            session.colordepth = 16;
        }
        else if (twentyfourBitRadio.Checked)
        {
            session.colordepth = 24;
        }
        else
        {
            session.colordepth = 32;
        }

        session.Resume();
    }

私の問題は、セッションオブジェクトと対話しようとする Form1_Load の外部にあるものはすべて、次の例外を引き起こすことです。

        base    {"Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))"}    System.Runtime.InteropServices.ExternalException {System.Runtime.InteropServices.COMException}
        ErrorCode   -2147418113 int

これが私のコードの完全なエラーであるとは思いません.COMを扱う場所に何かが正しく読み込まれてはいけないと思います.

ありがとう!

4

0 に答える 0