简体   繁体   English

未引发 AxRDPViewer 事件

[英]AxRDPViewer events not raised

I am using AxRDPViewer COM component msdn for remote assistance and out of nowhere its complementary events like OnConnectionEstablished,OnConnectionAuthenticated etc stopped to be raised.我正在使用 AxRDPViewer COM 组件msdn进行远程协助,并且它的补充事件如 OnConnectionEstablished、OnConnectionAuthenticated etc 无处可寻。

The component is hosted in WPF window like this该组件托管在 WPF window 中,就像这样

 <DockPanel Margin="1,0,1,0">
      <WindowsFormsHost x:Name="_FORMS_HOST">
          <WindowsFormsHost.Child>
              <rdp:AxRDPViewer  x:Name="RDP_VIEW" />
          </WindowsFormsHost.Child>
      </WindowsFormsHost>
 </DockPanel>

The component itself seem to work and i get connection correctly but still no events at all.该组件本身似乎工作,我得到正确的连接,但仍然没有任何事件。 There are no errors or exception thrown so its hard to understand where is the problem coming from.没有错误或异常抛出,因此很难理解问题出在哪里。

Hope someone has any idea where this could be coming from.希望有人知道这可能来自哪里。 Thanks!谢谢!

Edit编辑

It looks like the generated Com libraries are not generated correctly.看起来生成的 Com 库没有正确生成。 I replaced them with the older versions i had in previous builds and events started to be raised as intended.我用以前版本中的旧版本替换了它们,并且事件开始按预期提出。 The question is why generated libs AxInterop.RDPCOMAPILib.dll and Interop.RDPCOMAPILib.dll have those issues and how to get around it.问题是为什么生成的库 AxInterop.RDPCOMAPILib.dll 和 Interop.RDPCOMAPILib.dll 有这些问题以及如何解决这些问题。

I am using latest VS 2019 if it makes any difference.如果有任何区别,我正在使用最新的 VS 2019。

Thanks!谢谢!

The problem it seems was that AxInterop for windows forms was not generated correctly so instead a local copy was used that probably mismatched with the interop library.问题似乎是 windows forms 的 AxInterop 没有正确生成,因此使用了可能与互操作库不匹配的本地副本。 Adding this to the project resolved the problem将此添加到项目中解决了问题

    <COMReference Include="RDPCOMAPILib.dll">
        <Guid>cc802d05-ae07-4c15-b496-db9d22aa0a84</Guid>
        <VersionMajor>1</VersionMajor>
        <VersionMinor>0</VersionMinor>
        <WrapperTool>aximp</WrapperTool>
        <Lcid>0</Lcid>
        <Isolated>false</Isolated>
    </COMReference>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM