Web browser, dialogs, & kicking my pc

This is a discussion on Web browser, dialogs, & kicking my pc within the Windows Programming forums, part of the Platform Specific Boards category; Hey evrbdy. Merry Xmas from Jinx I was looking for a bit of info that someone could he me out ...

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

    Web browser, dialogs, & kicking my pc

    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 one spare a little help on this? Please?

  2. #2
    Registered User The15th's Avatar
    Join Date
    Aug 2001
    Posts
    125
    okay so you want to get the text from a edit control that is located in a dialog??? is that correct?

    Well it must be because from your code you only have to functions Get...Text() and Navigate2() which you gave no details about. Okay anyways to answer your question, i dont use GetDlgItemText() i do it like this

    //when dlg is initilized
    HwndEDT = GetDlgItem(hDlg,IDE_EDTCONTROL);

    //on okay button
    txtLength = GetWindowTextLength(hWndEDT);
    txtBuffer = (PTSTR) malloc ((txtLength + 1) * sizeof (TCHAR)) ;
    GetWindowText(hWndEDT,txtBuffer,txtLength + 1);

    Navigate2(...txtBuffer...);

    the reason i do it like that is because now i have a handle to my HwndEDT control, thats the way i find the easiest, anyway txtBuffer will now hold your txt from your Edit control.

    GetDlgItemText() takes 4 params i think not 2...

    Merry XMas
    arrh, i got nothing good to say.
    http://www.praxis1.vic.edu.au/home/dcola/

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Web browser based program
    By Lauris in forum C++ Programming
    Replies: 3
    Last Post: 11-14-2007, 04:01 PM
  2. HTTP Response from web browser
    By zort15 in forum C# Programming
    Replies: 0
    Last Post: 06-25-2007, 08:35 AM
  3. Replies: 1
    Last Post: 10-27-2006, 01:21 PM
  4. Socket web browser
    By digitaltsai in forum Networking/Device Communication
    Replies: 17
    Last Post: 10-09-2005, 08:20 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21