Results 1 to 2 of 2

Thread: displaying a web page in the same folder as the app

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Location
    Australia
    Posts
    243

    displaying a web page in the same folder as the app

    hi i have 2 questions:

    1) if i have a web control how do i navagate it to a web page called web.htm that is in the same folder as my app

    2) if i have a web control how do i navagate it to a wab page in a folder that is in the apps directiry

    e.g i want to navagate a web browser to the applications directry

    web.navagate......

    I am a newbie at this so if you can include all the code that would be great.

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Ok, I see two possibilites:
    a) You want to do this in VB. Then you're in the wrong forum.

    b) You want to do this in C++. Since you said "I have a web control" I'll assume that you already have a pointer to an IWebBrowser2 interface. Then you would do:
    Code:
    IWebBrowser2 *web;
    // ...
    BSTR url = SysAllocString(L"file:///c/program%20files/");
    VARIANT target;
    VariantInit(&target);
    target.vt = VT_BSTR;
    V_BSTR(&target) = SysAllocString(L"_SELF");
    VARIANT empty;
    VariantInit(&empty);
    web->Navigate(url, &empty, &target, &empty, &empty);
    This should work, but might not. Working with dual interfaces is awful, and I hate VB for forcing this **** on us.

    To make matters worse this board has the htmlentities disabled
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width