Search code examples
halcon

Opening HDevelop examples from internal function description


We have an extensive internal Halcon library, which is used by more and more people. Now we have arrived at the point, where it would be very useful if we could directly access HDevelop examples written specifically for this function as it is already available for MVTec's functions.

This is not possible at the moment, and MVTec will not provide this in the future (their words).

I have made some progress but I'm not able to find a solution.

If a text is filled in one of the boxes in Procedures/Edit Interface/General Documentation/Suggestions it generates an HTML link. Is is possible to start HDevelop using Internet Explorer:

<html>
<head>
<script type="text/javascript">
function foo() {
var WshShell = new ActiveXObject("WScript.Shell");
var oExec = WshShell.Exec("hdevelop.exe");
var input = "";

while (!oExec.StdOut.AtEndOfStream) {
input += oExec.StdOut.ReadLine() + "<br />";
}

if (input)
document.getElementById("dummy").innerHTML = input;
}
</script>
</head>
<body onload="foo();">
<code id="dummy"></code>
</body>
</html>

Unfortunately if the reference to an HTML document is local, it is opened inside the HDevelop's browser, which does not support ActiveX objects. If the reference starts with http, it is opened in your default browser.

Does anyone else have another solution which wouldn't require local server to access local files and setting your default browser to IE?


Solution

  • It is possible to do it by generating a simple HTML file:

    <html>
    <body>
    <TT><A HREF="file:///D:/YourExample.hdev">Example</A></TT>
    </body>
    </html>
    

    and referencing it in any of the Suggestions fields without the .html extension:

    enter image description here

    There is going to be one step more when accessing the example, where you have to click on the hyperlink "Example" because automatic redirecting is not working.

    enter image description here

    enter image description here