Thread: Web browser, dialogs, & kicking my pc

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

    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:

    void CJinxBrowserView::OnWwwDialog()
    CWWWDialogDlg dlg(this);
    if(IDOK //*<- OK button in the WwwDialog*// == TRUE)
    GetDlgItemText(IDC_EDIT_URL, m_strWwwUrl);

    Can some one spare a little help on this? Please?

  2. #2
    Registered User The15th's Avatar
    Join Date
    Aug 2001
    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);


    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.

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, 05: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