Welcome Guest Search | Active Topics | Sign In | Register

Update manifest entry on eowp.exe Options
PS
Posted: Thursday, May 23, 2019 6:20:23 AM
Rank: Advanced Member
Groups: Member

Joined: 10/24/2018
Posts: 97
Hello,

We have been debugging an issue for quite some time which was that several tooltips (for example from the HTML5 abbr tag) were not displaying in our application. While we have not managed to reproduce it in a standalone Windows Forms test application, we do have managed to find a fix for it.

Most important part is the following: Enabling Visual Styles

We had already enabled Visual Styles in our own application (via the linker directive), however we also needed to add the Microsoft.Windows.Common-Controls dependency to eowp.exe. After that the tooltips work as expected.

Our request to you is to enable visual styles via the manifest of eowp.exe, such that we do not need to modify it manually.
eo_support
Posted: Thursday, May 23, 2019 1:34:40 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,258
Hi,

eowp.exe already automatically loads the same manifest embedded inside EO.WebEngine.dll. It does this not by static linking, but by dynamically setting up activation context before running the browser engine. So it supposes to work properly. If you still seems problems, please try to reproduce it and we will be happy to investigate further.

In theory we could use static linking but not all users use eowp.exe --- some of them uses rundll32.exe and in that case we have to use dynamic loading instead of static linking. So we would prefer to use the same method that works for both cases.

One thing we can try on our end is instead of loaidn the manifest from EO.WebEngine.dll, we can load it from one of the system DLLs (such as System.Windows.Forms.dll) to see if it makes a difference for you --- however you would still probably want a repro project to verify any change we made on our side works for you.

Thanks!
PS
Posted: Friday, May 24, 2019 9:16:32 AM
Rank: Advanced Member
Groups: Member

Joined: 10/24/2018
Posts: 97
Thank you for your quick response!

With your information we have managed to reproduce the issue, it looks like the important part is that we have not deployed the assemblies next to the application, but instead load them from a database server to which our application connects.

The issue can be reproduced with the following code:
Quote:

using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace EOTestTooltip
{
static class Program
{
private static ConcurrentDictionary<string, Assembly> AssemblyCache { get; set; } = new ConcurrentDictionary<string, Assembly>();

private static Assembly baseAssembly;
private static Assembly engineAssembly;
private static Assembly browserAssembly;

/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
var enableBug = true;
AddAssemblyResolver(enableBug);
LoadAssemblies();
Application.Run(CreateForm());
}

private static void AddAssemblyResolver(bool enableBug)
{
AppDomain.CurrentDomain.AssemblyResolve += (sender, args) =>
{
string name;
if (args.Name.Contains(","))
{
name = args.Name.Split(',')[0];
}
else
{
name = args.Name;
}
return AssemblyCache.GetOrAdd(name, n =>
{
if (enableBug)
{
var bytes = File.ReadAllBytes($@"C:\Program Files (x86)\Essential Objects\EO.Total 2019\{n}.dll");
return Assembly.Load(bytes);
}
else
{
return Assembly.LoadFrom($@"C:\Program Files (x86)\Essential Objects\EO.Total 2019\{n}.dll");
}
});
};
}

private static void LoadAssemblies()
{
baseAssembly = Assembly.Load("EO.Base");
engineAssembly = Assembly.Load("EO.WebEngine");
browserAssembly = Assembly.Load("EO.WebBrowser");
}

private static Form CreateForm()
{
var form = new Form();

var types = browserAssembly.GetTypes();

var webViewType = browserAssembly.GetType("EO.WebBrowser.WebView");
var webView = webViewType.GetConstructor(new Type[] { }).Invoke(new object[] { });
webViewType.GetMethod("LoadHtml", new Type[] { typeof(string) }).Invoke(webView, new object[] { "<html><head><title>HTML</title></head><body><abbr title=\"This is a test.\">Test</abbr></body></html>" });

var webControlType = browserAssembly.GetType("EO.WinForm.WebControl");
var webControl = webControlType.GetConstructor(new Type[] { }).Invoke(new object[] { }) as Control;
webControlType.GetProperty("WebView").GetSetMethod().Invoke(webControl, new object[] { webView });
webControl.Dock = DockStyle.Fill;

form.Controls.Add(webControl);

return form;
}
}
}



We hope you can make a fix with the help of this code.
eo_support
Posted: Friday, May 24, 2019 6:04:31 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,258
OK. We will add the manifest to eowp.exe as well as EO.Base.dll. So now the manifest searching order will be: EO.WebEngine.dll, EO.Base.dll, eowp.exe. If all three are missing then visual style won't work.
eo_support
Posted: Wednesday, June 19, 2019 12:35:17 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,258
Hi,

We have posted a new build that added manifest to eowp.exe. This build also fixed the shortcut issue you reported in another thread. You can download the new build from our download page. Please take a look and let us know how it goes.

Thanks!
PS
Posted: Thursday, June 20, 2019 10:22:26 AM
Rank: Advanced Member
Groups: Member

Joined: 10/24/2018
Posts: 97
It looks that tooltips work again, nice! It only seems to work if the eowp.exe is deployed, so not if it's ran from memory/temp, but that's of no further concern for us as we deploy eowp.exe anymore.

Unfortunately this update does seem to have introduced newer/bigger issues revolving the Escape key, for that I have made a post at https://www.essentialobjects.com/forum/postsm47917_Escape-no-longer-works-properly-with-the-latest-build.aspx#47917.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.