How can IE load an application for a specific file type - com

I have an application that handles a particular set of extensions. If I want to be able to open that application inside my IE browser what do I have to support ?
From my research it looks like I will have to implement my application as a COM server and register a MIME handler. This way when IE encounters my extension it can use COM to load my application inside the browser and call my interfaces ?
Is this how its supposed to work ? I am thinking thats how pdf or msdocs get loaded inside browser ?

How to Register an ActiveX Object as the Player for a Media Type
See also MimeType.exe makes ActiveX object default MIME type player

Related

Is it possible to make WebView control to read local html files?

I'm making an application with WebView control. And I want it to read local html file. But I can't find the right way to make it possible.
At first, I simply tried to use Navigate method and provide the file path in the "file:///~" format string as a parameter, but it didn't work.
https://learn.microsoft.com/ja-jp/windows/communitytoolkit/controls/wpf-winforms/webview-known-issues
This Microsoft page says that WebView control does not recognize "file:///~" protocol.
And it shows the 3 solutions to make WebView control to read local html files.
Use NavigateToLocal() method.
Use NavigateToLocalStreamUri() method.
Use NavigateToString() method.
I tried all of them, but each 3 have some issues that doesn't make it work.
NavigateToLocal method requires a RELATIVE path of the file (not the absolute path), relative from the application executable directory. So files in somewhere else from the application directory cannot be read by this method.
NavigateToLocalStreamUri method is not even implemented according to the page! I once tried it anyway, but it returned an exception and didn't work.
NavigateToString method can render the given html content string, but the external files like css, js, image files included by html codes cannot be loaded, so it does not provide a full function.
I found some sample of using NavigateToLocalStreamUri method and tried it by myself.
(VB.NET)
wvwMain.NavigateToLocalStreamUri(uri, New StreamUriResolver())
Public Class StreamUriResolver : Implements IUriToStreamResolver
Public Function UriToStream(uri As Uri) As Stream Implements IUriToStreamResolver.UriToStream
Return New FileStream(uri.LocalPath, FileMode.Open)
End Function
End Class
By this code, NavigateToLocalStreamUri method returns System.Resources.MissingManifestResourceException.
What I want to realize is very simple.
Using WebView control
Read local html file located anywhere on the local storage
And render the html file completely as an expected result
But I don't see the way right now.
I would appreciate your advises or helps.
The method NavigateToLocalStreamUri will not work. Please see https://learn.microsoft.com/en-us/windows/communitytoolkit/controls/wpf-winforms/webview-known-issues.
You have to use NavigateToLocal, but you will see a warning that it is deprecated. However, it does only work with relative paths. Is it possible for you to restructure your application so that you can use relative paths?
The NavigateToLocal method is the only way that I've found to call local HTML files in Microsoft.Toolkit.Forms.UI.Controls.Web WebView v6.0.
On Visual Studio 2019 Windows 10, the following VB.NET code works on my PC
Imports System.IO
Dim sFileName = Application.StartupPath & "/MyPage.html"
wv.NavigateToString(System.IO.File.ReadAllText(sFileName))
where wv is a WebView object.

How to add a property page to DirectShow filter

I have written an DirectShow-Filter *.ax to integrate a Hardware (Camera). All works fine with my filter.ax and there Transport Images to Skype success.
Now I am want to integrate a Dialog to handle the camera-options with UI.
In my Filter.ax is calling the function QueryInterface(REFIID riid, void **ppv)
when riid == IID_ISpecifyPropertyPages
I am have seen that the Dialog must be in a other DLL like Com ?
My try to open the Dialog directly works, but no windows Messages are incoming.
I must also write an MFC Dll they is starting by PropertyPage IIID ? My Propertypage is a large MFC Controles TabControl with some items. I can see it if i start the filter from MFC Test app. AfxInit I can't execute. (Wrong Lib versions I must use the directshow baseclass(knowledge example)
I don't now why my Dialog got no Messages, what is the right way ?
You don't need to implement a property page in a separate DLL (even though it is a possible).
DirectShow filter property pages are regular COM property pages implemented using ISpecifyPropertyPages. Property pages are separate COM objects implementing well known interfaces like IPropertyPage.
Windows SDK Ezrgb24 sample shows how to implement a simple transform filter and also features a property page (CEZrgb24Properties class). It should be a good start for a property page implementation for your filter.
If you prefer to implement the property page in a separate DLL, a typical way is to define a shared COM interface, the filter would implement it and reference the property page by its CLSID, the property page would query this interface from the filter instance and use it for configuration actions.

IBM RFT does not find .net object from framework

I have to check a frame window with RFT which is written with a .net framework. My problem is, after adding the frame as Testobject via drag and drop to the script it works fine. But after restarting RFT, it isnt able to recognize that frame any more, neither with find method or the highlight function for objects.
I read that there is a way to add objects to the proxys. But this frame is declared at proxy .Net.FormProxy and this proxy is existing in the file rational_ft.rftcust as
<Obj L=".Proxy">
<ClassName>Rational.Test.Ft.Domain.Net.FormProxy</ClassName>
<Replaces/>
<UsedBy>[System.Windows.Forms]System.Windows.Forms.Form</UsedBy>
</Obj>
I dont get what is the problem. Especially, why is it working some times but not always.
Thx for help..
The problem you have mentioned may happen for the following reasons.
The object recognition is indeed changing . And it is not necessarily the object that you are having problem with has object recognition issue , but an object in the parent heirarchy of this object (unless this object is the top level object).
The second reason could be the application is not getting enabled during playback time and you can try getRootTestObject().enableForTesting(/) API to force enable the application.
On a recorded Form object in the Object Map try to use the "update recognition properties" to see if there is change in recognition properties in actual vs recorded object.
You can also just test a different simple Form Application to see if the issue is related to your application or if it is general issue in your environment( I suspect it to be related to the application).

Selenium WebDriverJS in browser getting user window object

With Selenium IDE I used this.browserbot.getUserWindow() for getting the window object, but I couldn't find a way doing it with the WebDriverJs.
Using the WebDriverJs is there a way to get the window object?
No, not easily.
SeleniumIDE works in the current browser, whereas WebDriver uses the JSON Wire Protocol to communicate with a potentially-remote browser. Your WebDriver code is not running in the target browser, so the window object is simply not there to be accessed. (If your code actually is running in the target browser, you can get the window object from that in the normal manner.)
You could attempt to serialize the window object and transmit it via Wire: there's a hint on how to do this in this answer. The effort is almost certainly not worth it.

How to display BlackOil in Petrel Function Window programatically

How do you display the Oil/Water/Gas components of a BlackOil domain object programatically on the FunctionWindow? I tried calling FunctionWindow.ShowObject on BlackOil.OilPhase but received an error that it could not be found on the input tree.
I need to say sorry here, but this is the bad case when you can get an programmatically access to the object via FluidFunctionCollection (you can create/update it), but you cannot get access to the same object via InputTree interface (you will receive an UnknownEntity via GetType method when try to navigate from Petrel UI to this object type and send it to your plug-in (doesn't exposed for Ocean from this site yet)), and by this reason you cannot display this object programmatically. I submitted an internal ticket for your case.