HTMLHelp in Automation Server - delphi

I have an application that utilizes a VCL Style and have found that CHM help files do not get styled correctly (among other issues). As a workaround, I created a COM automation server that does not utilize VCL styles and my styled application client app sends the necessary parameters (filename, help command, topic) to the automation server. The automation server (the main window of which is hidden) then calls Hthmlhelp: HtmlHelp(GetDesktopWindow, FName, ACommand, ATopic);
The problem is that the help viewer appears behind the client app if the client app is compiled in release mode. Oddly, the help viewer correctly appears on top of the client app if the client app was compiled in debug mode.
How can I get the help viewer to reliably launch on top of my client app? I of course don't want the help viewer to always stay on top even if the client app is clicked -- I just want the expected behavior that the help viewer is on top until the client app is clicked.

Related

Integrate WPF application into web application

Can a web application be integrated with WPF application. If there is a link in web application(ASP.NET MVC 5 in my case) which opens up the WPF application from my local machine, it should be great.
Requirement goes similar to something like gotomeeting where I click on a link(from web) and it opens up my locally installed gotomeeting.(Or launching my skype application from a link in web). In case the WPF app is not installed on local machine, it downloads the exe. In case the WPF app is updated, it updated the local app.
Checked ClickOnce on the WPF application, but somehow does not work as expected. The "launch" link in the publish.html works only with IE.
Can anyone please suggest me something to get started. If any articles or links are present, please post it here. I have gone through numerous links but did not get something which is extremely relevant.
Thanks,
Sam.
One of the things about web pages are in the browser in a security sandbox.
It is intentionally difficult for them to just "reach out" onto your machine and run some exe or other.
If your machine already has an application associated with a particular file extension then you can get it to do it's default action when such a file is delivered.
Like open a mail object in outlook.
To run an exe from a web app you'd have to rely on a custom file extension and deliver a file that the machine "knows" means run wpf application xyz.
Clickonce is likely to be problematic if you're passing objects in because it installs to the user's appdata. You can't predict where it will be.
Just running one works from a url, but to start up with an object out a page sounds like it could be problematic. I never tried it though.
You could conceivably make your wpf app an xbap. http://www.xbap.org/ That's wpf in a browser.
Or there is of course still Silverlight. I think that still goes out of support in 3 years and you're probably now limited to IE as well.

troubleshoot asp.net web app on iOS

I have a web app with asp.net mvc 5 on running on iis 7.5. I have a photo upload page that I made with DropZone (a javascript ajax upload plugin). In my asp.net controller during certain errors, I return an httpstatuscode of 500 with a status description with a descriptive error. DropZone then displays this descriptive error. Everything works as it should on desktop devices, however when used on an iOS device it displays a generic "Internal Server Error" message.
I'm lost at how to troubleshoot this issue. I've placed javascript alerts throughout my javascript code to try and figure out what the issue is but that didn't reveal anything helpful. I've tried using the MIHTool ipad app and the HttpWatchBasic ipad app to try and set breakpoints but that was not helpful either.
Is there a way to remotely debug an asp.net web app from an iPad? (I have visual studio 2013 premium) Or does anyone have any ideas what may be causing a different status code to be sent?
UPDATE: It appears that iOS devices ignore any custom xhr.statusText and uses the standard default statusText (i.e. code 500 is Internal Server Error). As a work around (which I hate doing, but since this is primarily for use on company iPads I didn't have much choice) I've returned a different 500 class code for each possible exception and then in the javascript code check the status code and assign my own custom error message in the javascript code.
Quickest and easiest way to see the actual exception is to turn off custom errors in your Web.config - you'll then be able to view the actual stacktrace on the iPad.
If you'd like to be able to debug the exception, you should be able to trigger it by accessing the site from the iPad by hitting your windows development machine while running in the debugger. You'll need to configure IIS express to allow remote connections (editing application host.config), adding a urlacl, and opening the Windows firewall if necessary. There are numerous guides in setting this up online.
If you want to actually debug the JS in mobile Safari, this is possible from the Mac version of Safari - see http://webdesign.tutsplus.com/articles/quick-tip-using-web-inspector-to-debug-mobile-safari--webdesign-8787 for details.

Delphi client that runs like it is connected to a web server - without a web server. Is it possible?

I am familiar with programming in Delphi stand-alone applications and web-server applications.
Is it possible to have a Delphi application that when launched gets the browser to handle its output? Without a server being between the user and the application.
The reason I would like to do this is because HTML CSS and so on provide a more familiar user-interface to most people.
You can not "let the browser handle its output" without any HTTP connection, so a local web server, then using regular URIs like http://localhost:888/myDelphiApp/FullURI.
What you can is to embed a Web Browser to your Delphi application, then provide the generated web content not via HTTP, but as local content.
You may use
THtmlViewer Open Source component - which I like very much;
Delphi Chromium Embedded;
WebBrowser Component.
All recognize CSS and HTML content.

TWebBrowser Cannot Open Blogspot Website

I'm using Delphi XE2 in Windows 7 64 bit, I put TWebBrowser component in a Form. I navigate it to a blogspot website, e.g:
Webbrowser1.Navigate('http://maniacpcgame.blogspot.com');
it shows JavaScript Error (HTML Parsing Error), then I turn Silent properties to True as follow:
Webbrowser1.Silent := true;
Webbrowser1.Navigate('http://maniacpcgame.blogspot.com');
But the browser cannot open the page properly (only show background image). I tried other blogspot websites and got same problem. Any solution to display blogspot website correctly in TWebBrowser?
Twebbrowser uses IEFRAME
IEFRAME depends on the version of internet explorer you are running on that computer
You can deploy IEFRAME.DLL (in c:windows/system32 )with your application so you can be sure the same version is used everywhere so you wont get inconsistencies between computers.
However newer ones wont work on XP and there are some directx requirements.
A good alternative is
Delphi Embed chromium, it makes your deployed application a lot bigger (+-15MB) but you can be very sure it works everywhere and always (windows 8 to XP) and it will always produce the same page
Also if you have to manipulate the DOM or insert javascript (to communicate with the page)
this will be easier and will work more consistently.
Here is a link for the latest version:
https://code.google.com/p/dcef3/

ActiveX cannot screen capture a page that is hosted on the same server

I have an app that takes a screenshot of web pages and creates a resized image. The app is basically loading a web page that calls an ActiveX to load a web page using IE resources and take the screenshot. This app has been running on a Windows Server 2003 without any problems for a couple of years.
But now that I have upgraded the server to Windows Server 2008, the screenshot action is timing out. From tests I can see that it successfully takes a screenshot of any web page hosted on the Internet... except pages hosted on the same server.
Whenever it tries to capture a page loaded on a site hosted on the same server as the app, it times out. ESC is disabled and it seems that all other permissions are ok, ie: it works for remote pages but for home pages.
Any ideas as to what can be causing this and how to fix it?
After further testing I have narrowed down the reason for failure being due to the page being popluated from a MS-SQL database record on the same server as the one taking the screenshot. The same page generated on a remote server captures ok. I have further established that the error is not peculiar to the ACASystems DLL because it also affects another DLL for creating MHT files from web pages. This DLL (Chilkat.MHT) also uses IE to load and assemble the web page on the fly and then saves it as a.mht file.
So the problem is more related to IE assembling web pages from MS-SQL while running ActiveX. But to resolve this enigma?
Maybe a routing issue (DNS/hostfile..) ? Does the page loads on local session with IE ?
There is no solution for this without editing the ActiveX code. Since the DLLs in question are third party resources, such editing is not possible.
After testing 3 different ActiveX that load a web page that either take a screenshot or save as .mht, it was found that they all failed when loading a page that was querying SQL on the same server. After contacting the 3 DLL developers we were informed by all of them that their ActiveX has no impact on MS-SQL.
Unfortunately, our tests tell us otherwise. At this stage we are left guessing however this article about in-process vs out-process execution may be related.
The workaround for us to solve this problem was to assemble the page to be captured from request queries passed to the page rather than populate from SQL queries. This alternate works perfectly.

Resources