Page 1 of 1

GetZoom fails

PostPosted: Mon Nov 04, 2013 6:38 pm
by dez
Hello!
I am using Xilium.CefGlue. I am currently testing the functionality of the library in WPF application. I have added GetZoom() method that looks like that:
Code: Select all
public double GetZoom()
       {
          double zoom = 0.0;
         _mainUiDispatcher.Invoke(DispatcherPriority.Normal, new Action(delegate
         {
            if (_browser != null)
            {
               _browserHost = _browser.GetHost();
               zoom = _browserHost.GetZoomLevel();
            }
         }));
          return zoom;
       }


GetZoomLevel is using public static double get_zoom_level(cef_browser_host_t* self)
Application fails on return statement return d(self);

Outputs:

3.5 Client Profile
'Xilium.CefGlue.Samples.WpfOsr.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_MSIL\System.Runtime.Serialization\3.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll'
The program '[10504] Xilium.CefGlue.Samples.WpfOsr.exe: Program Trace' has exited with code 0 (0x0).
The program '[10504] Xilium.CefGlue.Samples.WpfOsr.exe: Managed (v2.0.50727)' has exited with code -1073740940 (0xc0000374).

4.5
'Xilium.CefGlue.Samples.WpfOsr.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationTypes\v4.0_4.0.0.0__31bf3856ad364e35\UIAutomationTypes.dll'
The program '[7204] Xilium.CefGlue.Samples.WpfOsr.exe: Program Trace' has exited with code 0 (0x0).
The program '[7204] Xilium.CefGlue.Samples.WpfOsr.exe: Managed (v4.0.30319)' has exited with code -2147483645 (0x80000003).

Anyone experiencing this kind of issue?
Thank you!

P.S. Set zoom is working perfectly fine.

Re: GetZoom fails

PostPosted: Mon Nov 04, 2013 6:58 pm
by fddima
Hi.

It is hard to describe why, it is did not contains enough information.
You must note that this method valid to be called only on UI thread. I see that you are use UI dispatcher, but you are sure that it dispatch on CEF UI thread? I just ask, as for idea.

Also when it is happens, nearly browser start or nearly browser closing?

Or it is permanently did not works?

Also what's CEF/CefGlue version?

Re: GetZoom fails

PostPosted: Mon Nov 04, 2013 7:45 pm
by dez
Hello!

I am using 1448 build. Mostly I am using the supplied WPF sample application. I have added a buttons ZoomIn and ZoomOut.
Code: Select all
<Grid Grid.Row="0">

            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <TextBox Grid.Row="0" Name="addressTextBox" Text="http://html5test.com" KeyDown="addressTextBox_KeyDown_1" />

            <StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal">
                <Button Content="Zoom In" Click="ZoomInClick"/>
                <Button Content="Zoom Out" Click="ZoomOutClick"/>
            </StackPanel>
           
        </Grid>


For testing purpose I am using the ZoomIn button to read the current Zoom level. Here is the code:

Code: Select all
private void ZoomInClick(object sender, RoutedEventArgs e)
       {
          var zoom = browser.GetZoom();
         browser.SetZoom( 1.0 );
       }

private void ZoomOutClick(object sender, RoutedEventArgs e)
       {
         browser.SetZoom(-1.0);
       }


Code for ZoomOut works perfectly fine. I click the button when the application has started and page loaded.

Thank you!

Re: GetZoom fails

PostPosted: Tue Nov 05, 2013 3:18 am
by fddima
Can you switch to latest version?

Can you provide sample application code (with two buttons :) )?

Re: GetZoom fails

PostPosted: Tue Nov 05, 2013 9:00 am
by dez
I have just switched to 3.1650.1503 version. The problem is still there. I am using x64.
I am attaching the source code of the 3 project that I am using. Please compile the CEF 3.1650.1503 (45MB) and put the corresponding files to the x64 folder.

After running the application you will see two buttons on top. ZoomOut works fine. Zoom in tries to get the Zoom Level first and fails. Let me know if you have any questions or find anything that might cause the problem.

Thank you!

Re: GetZoom fails

PostPosted: Wed Nov 06, 2013 12:26 pm
by dez
just a quick update.
I have also tried the Windows Forms demo application and got the same result.

GetZoom fails

PostPosted: Fri Nov 22, 2013 12:35 pm
by Gankina
There arem't any special chars.
I found out that the first 2 lines with the "version-tag" were missing. Posibly i copied the files before clossing the Kepad-Mapper-Session.
The files from today were working perfect.