2

I am using AxRDPViewer COM component msdn for remote assistance and out of nowhere its complementary events like OnConnectionEstablished,OnConnectionAuthenticated e.t.c stopped to be raised.

The component is hosted in WPF window like this

 <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. 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.

I am using latest VS 2019 if it makes any difference.

Thanks!

NullReference
  • 862
  • 1
  • 11
  • 27
  • Can you share the code where you attach rdp viewer events? – adospace Jul 13 '20 at 13:31
  • I tried attaching them in code behind and xaml the result is the same, thing is that it seems that this is only happening on machines running latest windows 10 (2004,19041.329) build so i guess its MS that have messed it up. I guess you understand yourself that there cant be no wrong event subscription since it works on one os version and not on other. – NullReference Jul 13 '20 at 15:57
  • @NullReference I have a similar problem (https://stackoverflow.com/questions/62530215/how-to-recognize-when-logon-fails-in-rdp-mstsc). I spent days on that. What events do you need and what don't fire? – marsh-wiggle Jul 15 '20 at 07:52
  • Actually i want most of the events but so far i cant see any of them fired, as i said it looks like its due to latest Windows 10 update but i am still not sure. Is there any way we could get MS looking at it ? – NullReference Jul 15 '20 at 08:04
  • I updated my question, it looks like its not an OS update thing. What Visual Studio version are you using to compile ? – NullReference Jul 15 '20 at 08:57
  • @NullReference VS2019 – marsh-wiggle Jul 15 '20 at 09:03
  • Same here, i guess we need to find some one who could explain this generation problem . Can you try replacing the com libraries from your previous builds and see if that fixes it? – NullReference Jul 15 '20 at 09:13
  • @NullReference I have not build where it worked. My problem is that all events are fireing correctly except the one which doesn't fire when the remote machine is Server 2016 / 2019. When its Server2012 it works. – marsh-wiggle Jul 15 '20 at 09:16
  • @NullReference You could ask in a microsoft forum as well. https://social.msdn.microsoft.com/Forums/en-US/home – marsh-wiggle Jul 15 '20 at 09:29
  • I think i found it, basically the VS 2019 will set Tlbimp as Wrapper for your Interop assembly, what probably happens in my case is that generated AxInterop was not matching the interop library. Once i switched the Tlbimp to aximp as wrapper tool then correct AxInterop was generated and all events started to work! @marsh-wiggle give it a try please :) – NullReference Jul 15 '20 at 09:59
  • @NullReference Sounds good. Will check it, thanks and let you know. – marsh-wiggle Jul 15 '20 at 10:48

1 Answers1

1

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. 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>
NullReference
  • 862
  • 1
  • 11
  • 27