Developing ActiveX control for Windows CE - compact-framework

I have a few questions on Windows CE.
1.Does Windows CE supports use of ActiveX objects in HTML page?
2.Can ActiveX controls be developed/written in .Net C# with Visual Studio 2008 for use on Windows CE 5.0 IE Browser?
3.Is it necessary to install .NET CF in handheld device?
The requirement is to get local information about the device(IP, hostname, etc.) from the html page. I am currently doing R&D to find out how to achieve this. What we thought of doing is to call a custom ActiveX dll from html file which will run locally on the hand held device to get the required information and pass it to the html page.
If anyone knows of other ways to achieve this then please share.
Thanks

Yes, the CE browser supports COM objects that implement IObjectSafety.
No. The controls must be written in C++. To make it even more fun, they must be compiled for the device OS and processor architecture. The reason you can't create them in .NET is because the Compact Framework doesn't support EE hosting, so native code cannot call managed code on a device (inside our outside a browser).
This is orthogonal since the answer to #2 is no.
There may be another way to achieve your goal, but it's not clear what the actual problem is to me. You have a page served up from the device that needs to show the IP address to a browser on the same device? How does that user get to that page? If it's from an app, you could have the app either report it directly or have the app get the IP and save it into an HTML page which you then browse to.
EDIT
Based on your comments, if your customer won't allow the install of the CF, then they likely aren't going to want you to install an ActiveX component either (and if you could do .NET components, it would have required the CF be installed, so your requirements would have precluded doing so even if it were supported).
Why not write a simple C program that does what your CF program does (i.e. saving device info to an HTML file) and that requires no additional framework installs?

If your HTML is being served from a webserver, then it already knows the IP address that it is talking to (i.e. there might be some proxies in the way, but if they're behaving, they can tell you who the remote client really is), so you might not need to install anything.
As for the version of Internet Explorer installed on CE 5, I don't believe it supports ActiveX at all, but you could install a .Net application instead of using a webpage to solicit information?

Related

Tcl/Tk with WebKit?

Is it a realistic possibility to use WebKit (or any other available web engine) with Tcl/Tk to build the UI elements in a Tk top-level window based on HTML/CSS/JS?
I don't mean to build a web browser for viewing all internet content, but only to use it to display my content and store user input through interacting with a local SQLite database. I'd also like to be able to allow the user to update the database from a server when new information becomes available, but it is otherwise a desktop application requiring no connection to the internet.
I like Tk and may still use it only, but I'm having issues displaying multi-byte characters in RTL languages that I don't think can be resolved in the current version. I have this set up working as a web extension (which is mainly an application-specific UI library) using native-messaging to communicate with a C program compiled with the SQLite amalgamation file. It works fairly well, but I prefer to not have to depend on a web browser and have been trying to move it to Tcl/Tk.
Is this a stupid thought to consider a web engine, and I ought to just learn GTK or Qt, or perhaps Qt WebKit or WebKitGTK? I'm using Linux but would like it to work on Windows also.
Thank you.

How to develop (NPAPI) COM plugin for Chrome, Firefox, Safari [duplicate]

This question already has answers here:
How to write a browser plugin?
(4 answers)
Closed 9 years ago.
In my legacy web application I need to read user system registry from JS and do some other stuff. I cannot not use ActiveX for security reasons so I have written a plugin. My Plugin consists of a DLL file which is a COM component. This COM component exposes few functions which I call from Java Script code.
In IE I package my DLL in a CAB file and install it, say it's test.dll, in the following way:
<object classid="clsid:some class id here" codebase="test.cab" height="0" width="0" onError="testInstalled=false; return true;" id="testComp"></object>
The above HTML tag install the COM component as plugin in IE and Im able to access the exposed functions of the same from my JS code:
var testCompApp = document.testComp;
testCompApp.callSomeFunction();
It works fine in IE. I need the same functionality in other browsers(Chrome,Firefox, Safari)
Can you pls suggest how to develop plugins for other browsers using my DLL file?
Thanks,
I don't get it: First you say "I can't use ActiveX for security reasons", and then you do the same bad things that ActiveX does in all its dangerous glory: a CAB-packaged COM object running unrestricted native Win32.
How does doing that solve your security concerns with ActiveX?
Leaving aside for a minute the question of "security": if you are not doing "ActiveX" already, you're pretty close. I don't remember off the top of my head all the details of what goes into [the-IE-plug-in-architecture-that-shares-with-other-stuff-the-marketing-moniker-of] "ActiveX", but I think all you are missing to be called "ActiveX" is a few interfaces you must implement. I also suspect that by being shy of "ActiveX" you don't even get to sign your CAB with Authenticode, which would provide your users with a modicum of confidence (assuming you maintain proper controls and key management, and that your users trust you enough to allow your native code to run on their computers).
In any case, that DLL you wrote will only ever run in IE. There is no other browser that supports Win32 native COM objects (whether you choose to follow the ActiveX specification to the letter or not). If you want to do the same thing in other browsers, you are going to have to rewrite it with something else.
I think you have (at most) two options for doing what you want to do:
COM/ActiveX: Native Win32 code in a COM object. What you are doing now. This only works on IE and it's extremely dangerous for users, unless it's done in a controlled environment (e.g. if this is a commercial product to be distributed by an enterprise customer's IT department, or if you have an established presence and a reputation, like some large companies do).
Java:. This would run on all browsers assuming your users have the proper runtime installed and enabled. But it will only work for you if Java allows access to the information you seek via a sandbox-authorized method, because you can't call registry API's from the Java sandbox. The same goes for "the other stuff" you need the plug-in to do.
Ok, so you have a third option:
Reimplement the whole thing in something that is not tied to the browser: a native Windows executable; maybe in a downloadable installer or maybe a .NET program deployed via ClickOnce.
You are in a pickle: You are saying "I have security concerns with running ActiveX but I need to do something dangerous". Any piece of code downloadable and runnable by a web browser that is able to access the registry directly is - necessarily - a dangerous piece of code. Any conceivable technology that allows you to run such code from a browser will immediately elicit the very same security concerns that ActiveX elicits.
Indiscriminate access to the registry is out of the question from a modern browser sandboxed environment, so you either have to find a different source for the specific information you want, or you have to use ActiveX/COM running under IE.

Desktop Application upon Gecko/Mozilla or WebKit

How can I develop an installable desktop application on top of the Mozilla Engine or the Webkit engine.
We want to have best of both worlds, ease of development with DOM+Javascript+RenderingEngine+ContinuedImprovements in a Browser and user's control as in a desktop app
I looked at using C++ XPCOM for Mozilla but it seems to be quite complicated, Is there any other way to code like a WebApp using Javascript but burn it into the browser and dress it to give a feel of a desktop app. Also I require that javascript is compiled into native so that one cannot sneak into the source code
Are there any examples of desktop applications done this way ?
Web apps are fine but there are concerns of piracy, privacy, security and version control. The moot point is that in a web app the control lies with the software vendor, moreover the data is also with the vendor. Not only these, any changes to the application may also necessitate another around of training. What we want is that once the customer buys a version he is sure of what he owns and that he is in total control of it and we as software developer do not exposed our source code.
The issue is we have expertise in Web App development and we want to utilize that to develop a Desktop App
Your last point is that :
The issue is we have expertise in Web App development and we want to utilize that to develop a Desktop App
Well then BowLine can be an option though it requires Ruby, so you need to consider that. You can also take a look at WebKitDotNet if you are with .net Background.
Use XUL for the user interface and code your functions using JavaScript. You problably only need C++ to expose native functionality not yet available in Gecko. Examples of software that works this way: Komodo IDE, Songbird, Firefox and Thunderbird.

Web browser independent of IE

I would like to make a web browser for my own use with various customizations. However, in VB6 the various web related control like winsock, inet fetch only html. Using webbrowser control is not the answer because it uses the same settings as windows IE. What I'd like to know is a control somewhat like the webbrowser but independent of windows IE setting. So that the changes made in IE wont effect my web browser. And also the webbrowser control does not have features such as blocking a specific image/CSS according to URL etc.
What I want to know is that if it’s not possible to do with VB6, is it possible with Visual Basic 2010 Express?
winsock is a general purpose socket library and can communicate over the Internet to get all sort of data, not just HTML. And that's the answer to your question. If for some reason you want to create your own browser, you need to start from winsock.
Also, Visual Basic 2010 Express is the name of a particular version of IDE which is used to build programs in VB.NET which is the replacement for VB6. In conclusion, you can build your browser in either VB6 or VB.NET, however, I would recommend VB.NET as Microsoft has retired VB6 as a product and a technology.

Suggestions on including the web browser control in VB.Net desktop application

I am writing a desktop app in VB.Net, and I'd like to include a web browser control to automate certain functions the user might have to perform in the browser. I have to render the page so I do not want to use the webrequest to make direct calls. When I publish the app, do I have to be concerned with which version of Internet Explorer the user has on their machine? Are their any third party, freely available, stable web browser controls available for VB.Net that people are using?
You could always ignore the whole IE issue and use the Mozilla engine embedded in your app:
geckofx
"An open-source component for
embedding Mozilla Gecko (Firefox) in
.NET applications."
http://code.google.com/p/geckofx/
Several versions of Visual Studio support web browser controls. Here is an article on how to implement one.
http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx
The web browser control will work with different versions of Internet Explorer, but will be limited to the functionality supported by that version of Internet Explorer.
The article is based on Visual Studio 2008, but in the right corner of the article there are links, on how to use the web browser control, to earlier versions of Visual Studio.
If you embed the Webbrowser control in your application, what you're really doing is embedding a COM object. At runtime, your app will CoCreateInstance() the Webbrowser control, which will load it out of the version of SHDOCVW.DLL or IEFRAME.DLL that is currently on the machine. So, in plain English, you'll be getting the IE6, IE7 or IE8 Webbrowser control, depending on what is installed on the machine.
The practical differences, however, are minimal since the interfaces were published a long time ago and haven't changed over those versions. Differences in terms of different commands that some interfaces (such as IOleCommandTarget) support are abstracted away by the managed layer anyway, so you don't have to worry about that. The biggest difference will be rendering differences, since there is a huge delta in CSS conformance between IE6 and IE8. You'll have to test the various versions using Microsoft's app compat VHDs.
When I worked on the IE team application compatability wrt the Webbrowser control was a huge deal; the team works very hard to make sure that behavior doesn't regress for precisely this scenario—the custom enterprise VB app hosting the WebOC.
Though if you decide to go with an open-source solution to distribute with your app, may I suggest WebKit? Its layout engine is very good and the source code is pretty well maintained and easy to read, though you'll have to write your own managed hosting layer. The Gecko code is much harder to read and debug.