Invoking Browser from my C++ application

I am writing a C++ program that needs to invoke the Netscape browser within the program to display a HTML file that I have created. How do I invoke the browser through my program ? How do I have the browser fetch my web page ? My web page will be a simple HTML file that does not contain any script.

arnold_w wrote:
Aren't all standard LabVIEW VIs really DLLs underneath the surface?
NO, LabVIEW is a programming language and contains a lot of primitives. Some VIs are wrappers for DLL's but even calling these from C(#) might be a problem.
You can exploit the LabVIEW ActiveX interface to perform all the actions you want.
Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas
LabVIEW, programming like it should be!

Similar Messages

  • Invoke browser from air desktop application

    Hi,
    How do I start the browser (if not running), and load a web page into a specific tab of the default browser? Is this possible?
    Thanks

    I still have a problem with this. I call
         navigateToURL(new URLRequest ("http://www.adobe.com"), "Foo");
    But it starts a new browser tab (Firefox) every time. I specify the custom name so it re-uses the same tab.

  • Attempting to launch a help browser from a java application

    I am currently investigating being able to view help html files through launching a browser from my Java application. I have come across the java.lang.Runtime and java.lang.Process classes which allow me to launch a browser like Netscape or Explorer and bring up a html file to view.
    What I want to do is launch the browser and bring up an html index file as well as the required html help file every time a user would like to use the help for my application.
    Is this possible using the other exec commands. If so, how? Is there somewhere I can find a user guide for Netscape and Explorer commands in order to send additional commands to the browser in order to do this.
    Thanks.

    Good news is it must be possible because VisualAge does it but I don't know how.

  • Launch a default web browser from my java application

    Hello,
    I have been trying to launch my default web browser from my java application, but am unable do it. Right now, I am using ---- "Runtime.getRuntime().exec("cmd /c start <url>"); to launch my webbrowser. It launches the browser but displays the command prompt for a second or so, and then replaces my already existing page with the new url.
    Is there any way for me to launch the url in a completely new browser each and every time. And I don't want the command prompt to show up for a sec. Please help...!
    Thanks in advance.
    -BusyBusyBee

    If by any chance your application is an Applet, you can use this to open a new browser window:
    getAppletContext().showDocument(new URL(theUrl), "_blank");
    But, you probably would have specified if that were the case. Oh well. Hope it helps someone!
    -sheepy.

  • How can I launch a web browser from my Java application?

    I've reed about this at Question of the Week (http://developer.java.sun.com/developer/qow/archive/15/index.html). It doesn't work for me. I'm running win2000 and trying:
    try {
    Runtime.getRuntime().exec("start iexplore http://java.sun.com");
    } catch (Exception e) {
    System.out.println( e.getMessage() );
    I get:
    CreateProcess: start iexplore http://java.sun.com error=2
    What's wrong?

    This function will launch the default browser under Windows.
    public static void displayURL(String url) throws IOException   {
        String cmd = null;
        Process p;
        try  {
            String os = System.getProperty("os.name");     
            if (os != null && os.startsWith("Windows")) {
                if (os.startsWith("Windows 9") || os.startsWith("Windows Me"))  // Windows 9x/Me
                    cmd = "start " + url;
                else // Windows NT/2000/XP
                    cmd = "cmd /c start " + url;
                p = Runtime.getRuntime().exec(cmd);     
        catch(IOException x)        {
            // couldn't exec browser
            System.err.println("Could not invoke browser, command=" + cmd);

  • Invoking jvm from a java application

    hello people,
    i would like to run a java application 'B' from within another java application 'A'. i have a thread sub class that does this. it is given
    below: (please pay attention to the run method)
    import java.io.*;
    import javax.swing.*;
    public class InvokingThread extends Thread
    private File n=null;
    private JTextArea outputArea;
    private String message="",action="";
    private String pathToBin,errors,input,classpath;
    private EvaluatorClient clientRef;
    //initialize InvokingThread object
    public InvokingThread(File name,String act,String path,String cp)
    outputArea=new JTextArea(10,25);
    outputArea.setEditable(false);
    outputArea.setLineWrap(true);
    n=name;
    pathToBin=path;
    classpath=cp;
    action=act;
    System.out.println((action.equals("compile"))?"compiling":"executing");
    public void setClientRef(EvaluatorClient r)
    clientRef=r;
    //process action
    public void run()
    Process proce=null;
    try
    if(action.equals("compile"))
    proce = Runtime.getRuntime().exec(pathToBin+"/javac "+n);
    else if(action.equals("execute"))
    proce = Runtime.getRuntime().exec(pathToBin+"/java "+classpath+" "+n); //run application
    Thread.sleep(5000);
    byte[] errorData = new byte[proce.getErrorStream().available()];
    proce.getErrorStream().read(errorData);
    byte[] inputData = new byte[proce.getInputStream().available()];
    proce.getInputStream().read(inputData);
    errors = new String(errorData);
    input = new String(inputData);
    System.out.println((errors.length()>0)?"error string"+errors:"no errors");
    System.out.println((input.length()>0)?"input string"+input:"");
    if (errors.length() == 0 & action.equals("compile"))
    outputArea.setText("Compiled successfully");
    if(clientRef!=null)
    if(!clientRef.isTimeUp())
    clientRef.toggleMenuItemState(4,true);
    clientRef.toggleMenuItemState(5,true);
    clientRef.compilationOutcome("success");
    JOptionPane.showMessageDialog(null,new JScrollPane(outputArea));
    else if (errors.length() != 0 & action.equals("compile"))
    outputArea.setText("Compile Errors:\n" + errors+""+input);
    if(clientRef!=null)
    clientRef.compilationOutcome("failure");
    JOptionPane.showMessageDialog(null,new JScrollPane(outputArea));
    else if(action.equals("execute"))
    if(errors.length() != 0)
    outputArea.setText("Runtime errors:\n" + errors);
    JOptionPane.showMessageDialog(null,new JScrollPane(outputArea));
    else if(input.length()!=0 )
    outputArea.setText(input);
    JOptionPane.showMessageDialog(null,new JScrollPane(outputArea));
    catch(Exception e)
    e.printStackTrace();
    System.out.println("thread awake,invoking thread terminating");
    }//end run
    The above code worked when i used it with the rest of my program.
    as we can see the thread waits for 5 seconds before it reads the inputstream and error stream of the sub process returned by Runtime.getRuntime().exec(). But what happens after the thread terminates; i am unable to process subsequent runtime messages/exceptions from the application 'B'.
    so my question goes thus: is there a way that my thread can continually listen to the error stream and input stream of the sub process while application 'B' is still running so as to process any messages returned by java form the application 'B' ? or is there a better way of doing what i set out to achieve i.e running a java application from within another java application
    timi

    Runtime.getRuntime().exec("rundll32
    url.dll,FileProtocolHandler
    mailto:[email protected]&subject=Foo&body=Bar");yawmark, where do you get such information from? (in all seriousness :-) )
    How (the hell) can you find out what args to pass to a program?
    and is "FileProtocolHandler" a place-holder? if so what for?
    thanks, :)
    lutha

  • How to invoke browser from java program in Solaris ?

    Hi all,
    Is there any way by which a browser can be opened with specific URL, from a java program in solaris OS ?
    In windows I am able to do so by using "rundll32 url.dll,FileProtocolHandler".
    Thanks,
    ngs

    Well, how is a browser normally invoked on Solaris? And have a look at JDIC, maybe it helps you.

  • Opening a browser from a swing application

    hi,
    I want to open a browser (with specific URL) from my application, on the actionEvent of certain Button. Is it possible ? If any body is aware of it plz help me.
    Thanks
    Atul

    Try out the following site,
    http://www.stanford.edu/~ejalbert/software/BrowserLauncher/
    rgds
    Ravi

  • Open URL in Web Browser from a Java Application

    Hi,
    I have an HTML document that I want to load in a browser window by clicking on a button in my java GUI application.
    Any suggestions?
    Thanks.

    You can use the Process class to start the web browser with the proper command line arguments (depends on the web browser though). Or on windows, you can have your program create a batch file with the code start url (where [url] is your url), and this will open the default web browser when run (again you must run it with a Process).

  • Open default browser from a java application

    How is possible to make a java application that open an html file in the default browser ?
    Thankyou
    [email protected]

    You can do that by running the command "start <url>", for example using Runtime.exec().
    Runtime.getRuntime().exec("start http://java.sun.com");Jesper

  • Launching a Browser from a Java Application

    I want to open an HTML page in the "default" browser. I know how to run commands so I could open IE or Netscape but I want to open a browser without having to know what browser they have installed. It would be nice if there is something that isn't platform dependent. Is this possible?

    It would be nice if there is something that isn't platform dependent. So you've seen the java tip
    http://www.javaworld.com/javaworld/javatips/jw-javatip66.html
    I don't think it's that easy to do what you want so that it is portable... sad that the current API doesn't have great support for programs written in other languages than Java.

  • Closing browser from a java application

    I have an applet having a button Save on it. I am calling a javascript function of closing the browser. But if i click it, a built in message comes to confirm the closing of browser having two opitons Yes and No. Is there any possibility that the browser closes without showing this message?

    May this is the wrong forum to post this message. However you could avoid that close-dialog by setting an opener
      function closeWindow() {
        window.opener="x";
        window.close();
      }So you can fake an self-opened window.
    The behaviour depends on used browser. So this should work for IE and Opera but not for Netscape...
    br
    karl

  • Any new ideas for launching web browser from application

    I have searched the forums trying to find a new way of launching a web browser from a java application. The problem I am having is that on Unix and Linux systems, at least the variety I have access to (not quite sure on what that variety those are as they are not my systems or systems I control), the common method of using Runtime.getRuntime().exec(STRING) with either netscape or mozilla does not work. While using the Runtime.exec method is not the same as a console, I did try on these systems "netscape + A_WEB_ADDRESS" (or mozilla) and it did launch the respective browser with the page, so it appears that at least from the console level, those commands are valid.
    All the forums seem to say that the Runtime.exec method is the way to go. All the source code I have found through links from the forum say the same thing. I have voted on this bug:
    http://developer.java.sun.com/developer/bugParade/bugs/4210168.html
    and the feedback there does seem to indicate that there is similar trouble out there. Below is the code I am using. It does work on Win2000,XP, and Mac OSX. The application is not supported on earlier systems, and as it stands it will not work on Win 95,98, nor ME. Only small modification should be needed for work on those OSs, but as I no longer personally use those OSs, I cannot be sure.
    private void openNativeBrowser(String url) {
    // not the browser itself is started, i only call something like
    // start http://www.javasoft.com
    // and then the standardbrowser will be started ...
    StringBuffer call = new StringBuffer();
    System.err.println(System.getProperty("os.name"));
    System.err.println(System.getProperty("user.dir"));
    try {
    // which OS ?
    String operatingSystem = System.getProperty("os.name");
    // how to call the OS
    if (operatingSystem.toLowerCase().indexOf("windows") > -1)
    call.append("cmd /c start ").append(url);
    else
    if (operatingSystem.toLowerCase().indexOf("mac") > -1)
    call.append("open ").append(url + " &");
    else if(operatingSystem.toLowerCase().indexOf("linux") > -1)
    // use Script 'netscape'
    call.append("mozilla ").append(url).append(" &");
    else
    call.append("netscape ").append(url).append(" &");
    System.err.println(call.toString());
    // start it ...
    Runtime.getRuntime().exec(call.toString());
    catch (Exception e) {
    System.out.println(e.getMessage());
    e.printStackTrace();
    As I said, if you have a new way to call the broswer that seems to work on either Unix or Linux, please post it, point to it, or explain it.
    Aaron

    there is a shell script on Linux called htmlview that you can launch like this:
    String[] cmd = {"htmlview", "http://java.sun.com"};
    try {
        Runtime.getRuntime().exec(cmd);
    } catch (IOException ioe) {
        // do something
    }which will open the default browser. Don't think this is available on other *NIX though, although the script itself would probably work so you could include it with your app (/usr/bin/htmlview).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Launching Browser from Swing Applicaton....

    Hi,
    i am launching browser from my swing application.While opening HTML file, always the HTML file goes behind the application.Everytime i have to maximize the html file window.
    i want the HTML file to come up in front of the swing application.
    any help please ??? itz very urgent.....
    Thanks in advance.
    Manikandan

    Browser Utility - Class to launch a URL in a web browser in
    a platform independent manner. Includes an optional swing
    GUI allowing user customization. [Open Source - GPL]
    http://ostermiller.org/utils/Browser.html
    BrowserLauncher - Open the system web browser with
    particular attention paid to various Macintosh systems.
    (Freeware)
    http://browserlauncher.sourceforge.net/
    Java World - With a little platform-specific Java code, you
    can easily use your system's default browser to display any
    URL in Windows or Unix.
    http://www.javaworld.com/javaworld/javatips/jw-javatip66.html
    JConfig - Class Libraries that allow a URL to be launched in
    a browser on Windows, Unix, or Macintosh. [Commercial]
    http://www.tolstoy.com/samizdat/jconfig.html
    Apple - MRJFileUtils.openURL() not implemented in Mac OS X.
    http://developer.apple.com/techpubs/macosx/ReleaseNotes/JavaGMWebReleaseNotes.html#MRJToolkit
    Apple - How one would open a URL in a web browser on a
    Macintosh.
    http://developer.apple.com/qa/java/java12.html

  • Encoding Error when invoking form from client application.

    I have an issue in retrieving the form data from the client application. Form (XDP File) is displayed in the browser as PDF through
    ServletOutputStream then i am trying to retrieve the data on click of the submit button. At that time the following exception is thrown:
    [8/17/07 9:20:18:212 EDT] 00000029 jsf E com.sun.faces.application.ViewHandlerImpl setRequestEncoding SRVE0254E: Failed to set request character encoding: ["utf-16"].
    java.io.UnsupportedEncodingException: SRVE0254E: Failed to set request character encoding: ["utf-16"].
    at com.ibm.ws.webcontainer.srt.SRTServletRequest.setCharacterEncoding(SRTServletRequest.java :231)
    at javax.servlet.ServletRequestWrapper.setCharacterEncoding(ServletRequestWrapper.java:158)
    at com.sun.faces.application.ViewHandlerImpl.setRequestEncoding(ViewHandlerImpl.java:364)
    at com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:267)
    at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:158)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:239)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:91)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
    at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
    at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3129)
    at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
    at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink .java:465)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink .java:394)
    at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.jav a:102)
    at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionLi stener.java:152)
    at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
    at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
    at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
    at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)
    at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)
    at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)
    Note: I am able to retrieve the data, if I store the same PDF file in the local disk and invoke it from my JSP Faces file.
    i appreciate if any one can help me to resolve this issue.

    Please update me if any one have idea on this issue.

Maybe you are looking for

  • Mavericks 10.9.1 Upgrade = Audio issue (lost 5.1 through HDMI)

    Hello guys and gals, I've Macbook pro 15" retina connected as follow Macbook Pro -> Sony HT -> LG LED TV (55LA7400) The connection is made via HDMI port. Everything was working fine, no issue when I was using previous OS. Apps such as XBMC, etc was a

  • Replacing the value in a list

    All, A quick question. How do we replace the value of role attribute with some other value?  When I try to set it, the new role is just getting appended.  I wanted to remove the olde role and set the new role.  I know I can remove the roles by settin

  • Macbook Pro 2011 destroys SD cards!

    Here's a weird one. I take a perfectly good SD card out of my Canon SD750 point and shoot, and put it in the side slot on my 2011 MBP, import the photos into iPhoto, and eject the card by dragging it to the wastebasket.  When I put the card back into

  • MS SQL to Oracle Integration.

    Hi, I want to load data from MS SQL to Oracle using interface. Can anybody tell me what are the steps to do this using ODI tool ? Which LKM,IKM I should use for this ? Thanks in advance, Shrinvas Edited by: 878809 on Aug 25, 2011 12:39 AM

  • Multi Value User Defined field on OIM user form

    Hi Everyone, I have a requirement where i need to assign multiple resources to user as per access policy. These resources should be assign by virtue of some role (custom attribute as of now). The specific requirement is that one user may have multipl