Display and WPF

Hello,
I am using a WPF application with a display OCX.
I’ve added a in a grid:

        <WindowsFormsHost>
            <local:CvbDisplay x:Name="cvDisplay" BackColor="Window"/>
        </WindowsFormsHost>
        <Button Content="Test" Height="50" Width="50"/>

When I do that, it is impossible with WPF to see a button (in execution mode) that has been added on the dispay (in the xaml code).

I have seen in C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Stemmer.Cvb.Wpf\v4.0_1.8.0.0__865233c490b278f9\Stemmer.Cvb.Wpf.dll that stemmer a desinged a WPF display control that corrects that effect.

My problem is that we have done a c++ OCX edxDisplay based on “CCVdisplay m_Display;” (it interceps also events from cvdisplay). That OCX has its own overlays management adapted to our use.
So we have the same problem with edxdisplay.ocx that there is with cvdisplay.ocx: impossible with WPF to see a button placed on the display.

My question are: if a specific display for WPF designed in Stemmer.Cvb.Wpf.dll solves that effects. How have you done to implement cvdisplay.ocx in Stemmer.Cvb.Wpf.dll to solve the problem? Do you have details?
I will need to do the same with my edxdisplay.ocx (based on cvdisplay).

Thanks in advance,
Best regards,
Mikael Person

Hello @Mikael,

what you see is called airspace problem. WPF doesn’t use HWNDs for its controls but does its own rendering. If you add an ActiveX control, this is placed in an HWND resulting in a ‘hole’ in the WPF window (not just the current control). For in-depth information see the Microsoft article:

https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-3.5/aa970688(v=vs.90)

And yes, this is the reason why we wrote our own :cvb: WPF Display.

1 Like

Also to be clear(er): this is not a Display.dll/.ocx wrapper, but a pure WPF implementation displaying our Image objects (object oriented wrappers):

https://forum.commonvisionblox.com/t/getting-started-with-cvb-net/

OK. Thanks for you support.
Mikael.