GetZoom fails

Having problems with building or using the CefGlue .NET/Mono binding? Ask your questions here.

Moderator: fddima

GetZoom fails

Postby dez » Mon Nov 04, 2013 6:38 pm

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.
dez
Newbie
 
Posts: 5
Joined: Thu Oct 31, 2013 3:49 pm

Re: GetZoom fails

Postby fddima » Mon Nov 04, 2013 6:58 pm

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?
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: GetZoom fails

Postby dez » Mon Nov 04, 2013 7:45 pm

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!
dez
Newbie
 
Posts: 5
Joined: Thu Oct 31, 2013 3:49 pm

Re: GetZoom fails

Postby fddima » Tue Nov 05, 2013 3:18 am

Can you switch to latest version?

Can you provide sample application code (with two buttons :) )?
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: GetZoom fails

Postby dez » Tue Nov 05, 2013 9:00 am

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!
Attachments
XiliumDemo.zip
test source code without CEF3
(959.57 KiB) Downloaded 798 times
dez
Newbie
 
Posts: 5
Joined: Thu Oct 31, 2013 3:49 pm

Re: GetZoom fails

Postby dez » Wed Nov 06, 2013 12:26 pm

just a quick update.
I have also tried the Windows Forms demo application and got the same result.
dez
Newbie
 
Posts: 5
Joined: Thu Oct 31, 2013 3:49 pm

GetZoom fails

Postby Gankina » Fri Nov 22, 2013 12:35 pm

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.
научные исследования по теме урология анализы, пушкарь уролог - расскажем о аденокарцинома простаты на современная-урология.рф
Gankina
Newbie
 
Posts: 1
Joined: Thu Nov 21, 2013 4:53 pm
Location: Россия


Return to CefGlue Forum

Who is online

Users browsing this forum: No registered users and 12 guests