#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Posts
    1
    Rep Power
    0

    Borland C++ Builder using Delphi Forms question


    Hi All ,
    I am damn new to C++ and delphi and am asked to do this little project.
    I need help.
    I am using a web browser(CppWebBrowswer1) and call the navigate method , CppWebBrowser1->navigate(url).This url is an exception page(html page) on a mobile vehicle and is accessed as the vehicle comes in range of the access point.
    This HTML page is generated bu software running ont he vehicle.

    MY PROBLEM -- I print the page directly
    CppWebBrowser1->ExecWB(Shdocvw_tlb::OLECMDID_PRINT,Shdocvw_tlb::OLECMDEXECOPT_DONTPROMPTUSER);

    onDocumentComplete(..or OnNavigateComplete2). The problem is I need to check if there is a HTML page because, at times , i get this HTTP 404(page not found print out).That is the application tries to print a page faster than it is generated by the software on the mobile vehicle.

    I need to be able to some how check to see if the page exists( if the server on the mobile vehicle returns HTTP 404), and if not, not to print.
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,643
    Rep Power
    4248
    The DocumentComplete event never worked correctly for me. I use the ProgressChange event instead:
    Code:
    procedure TfrmMain.WebBrowserProgressChange(Sender: TObject; Progress,
    	ProgressMax: Integer);
    begin
    	if Progress = -1 then
    		bReadPage := true;
    end;
    Elsewhere in the code, I have:
    Code:
    bReadPage := false;
    WebBrowser.Navigate('http://www.foo.com/');
    while not bReadPage do
            Application.ProcessMessages;
    This has always worked for me.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo

IMN logo majestic logo threadwatch logo seochat tools logo