Thread: WebBrowsers, Dialogs, Kicking your computer...

  1. #1
    Caffienated jinx's Avatar
    Join Date
    Oct 2001
    Posts
    234

    WebBrowsers, Dialogs, Kicking your computer...

    Hey evrbdy. Merry Xmas from Jinx

    I was looking for a bit of info that someone could he me out with. I'm building a small web browser with MSVC++ and have an event were a dialog (IDD_WWWDialogDlg) pops up and you enter a web address to goto. I've tried several different combos to try to get the DDX to work out and ended in sorrow when I kicked my computer, knocking it over, feeling somwhat better about it though. This is the basics of what I used:

    Code:
    void CJinxBrowserView::OnWwwDialog()
    {
       CWWWDialogDlg dlg(this);
       dlg.DoModal();
       if(IDOK //*<- OK button in the WwwDialog*// == TRUE)
       { 
          GetDlgItemText(IDC_EDIT_URL, m_strWwwUrl);  
          Navigate2(_T(m_strWwwUrl)NULL,NULL);
       }
    }
    Can some on spare a little help? Please?
    Last edited by jinx; 12-22-2001 at 05:39 PM.
    Weeel, itss aboot tieme wee goo back too Canada, eeehy boyss.

  2. #2
    Registered User
    Join Date
    Aug 2001
    Posts
    223

    dlg.DoModal()

    You cannot get text from a dialog after calling .DoModal(); because the window no longer exists.
    Instead grab the data from its data member variable...
    In your dialog class add a data member named m_strUrl or something. Then map it the edit box.. which I think you already have IDC_EDIT_URL, m_strWwwUrl. Then change your code to the following:

    void CJinxBrowserView::OnWwwDialog()
    {
    CWWWDialogDlg dlg;
    if( dlg.DoModal() == IDOK)//*<- OK button in the WwwDialog*// == TRUE)
    {
    Navigate2(_T(dlg.m_strWwwUrl)NULL,NULL);
    }
    }

  3. #3
    Caffienated jinx's Avatar
    Join Date
    Oct 2001
    Posts
    234
    Thanks for the reply zMan, and merry christmas, felize Novidad, Joyful Yom Kippur or which ever applies. I am not at home right now, so I can't compile yet, but thanks in advance b/c I'm sure it will work.

    And to all a Good Night!

  4. #4
    Caffienated jinx's Avatar
    Join Date
    Oct 2001
    Posts
    234
    Hmmm.... Something went awry...I got an error. I used your code zMan but something is not quite right.

    The part:
    Code:
    Navigate2(_T(dlg.m_strSomeString)NULL,NULL
    (Note: the m_strSomeString is really something else.)
    Returns an error, you compile it and see whate happens, will you?
    Weeel, itss aboot tieme wee goo back too Canada, eeehy boyss.

  5. #5
    Caffienated jinx's Avatar
    Join Date
    Oct 2001
    Posts
    234
    the ecxact error I recieved was

    Code:
    error: missing ( before "constant"
    error: missing )
    Sooooooo I dunno what to do now.

  6. #6
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Navigate2(_T(dlg.m_strSomeString)NULL,NULL);


    Hm....maybe?

  7. #7
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    Navigate2(_T(dlg.m_strSomeString),NULL,NULL);


    I don't know what the function does... but common syntax dictates that there has to be a comma there. You can drop the _T() macro. You are passing a CString anyway, it's Unicode.

    Navigate2( dlg.m_strSomeString,NULL,NULL);
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  8. #8
    Caffienated jinx's Avatar
    Join Date
    Oct 2001
    Posts
    234
    Hey, just tried it, btw my post was using incorrect syntax, Sorry. But anyhow, I tried the Navigate2() (used to "Navigate to" a certain web page, pending the string passed to it) and came out with no errors! But, theres always a "but", I tried my new function and came out with a debug assertion . Should I just give up?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 34
    Last Post: 02-26-2006, 01:16 PM
  2. Major Computer Problem
    By Olidivera in forum Tech Board
    Replies: 10
    Last Post: 07-15-2005, 11:15 AM
  3. Tabbed Windows with MDI?
    By willc0de4food in forum Windows Programming
    Replies: 25
    Last Post: 05-19-2005, 10:58 PM
  4. Computer will not boot.
    By RealityFusion in forum Tech Board
    Replies: 25
    Last Post: 09-10-2004, 04:05 PM
  5. Web browser, dialogs, & kicking my pc
    By jinx in forum Windows Programming
    Replies: 1
    Last Post: 12-22-2001, 06:47 PM