Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Problem in Getting Handle of EditBox.

Problem in Getting Handle of EditBox.

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Atul23
    wrote on last edited by
    #1

    Hi Friends, I have difficulties in getting handle of EditBox when I get the value of edit box. Following code is execute correctly when i set value to edit box CEdit *pOpenEdit = (CEdit *) GetDlgItem(IDC_FOLDER_PATH); if( NULL != pOpenEdit->GetSafeHwnd() ) { if( strOpenPath != "" ) pOpenEdit->SetWindowText(strOpenPath); } But when I want to get value of edit box , i did not get the handle of edit box. so it did not entered in if Block. CEdit *pOpenEdit = (CEdit *)GetDlgItem(IDC_FOLDER_PATH); if( NULL != pOpenEdit->GetSafeHwnd() ) { char buff[500]; pOpenEdit->GetWindowText(buff,256); strOpenLocation = buff; } So please let me know what is wrong in this code. Thanks in Advance Atul

    P H 2 Replies Last reply
    0
    • A Atul23

      Hi Friends, I have difficulties in getting handle of EditBox when I get the value of edit box. Following code is execute correctly when i set value to edit box CEdit *pOpenEdit = (CEdit *) GetDlgItem(IDC_FOLDER_PATH); if( NULL != pOpenEdit->GetSafeHwnd() ) { if( strOpenPath != "" ) pOpenEdit->SetWindowText(strOpenPath); } But when I want to get value of edit box , i did not get the handle of edit box. so it did not entered in if Block. CEdit *pOpenEdit = (CEdit *)GetDlgItem(IDC_FOLDER_PATH); if( NULL != pOpenEdit->GetSafeHwnd() ) { char buff[500]; pOpenEdit->GetWindowText(buff,256); strOpenLocation = buff; } So please let me know what is wrong in this code. Thanks in Advance Atul

      P Offline
      P Offline
      Peter Weyzen
      wrote on last edited by
      #2

      Your error is not in the block of code you are showing me. I would assume that at the time that you are "getting" the value -- your dialog has been closed... When are you calling this "get"?

      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Peter Weyzen Staff Engineer [SoonR Inc -- PC Power delivered to your phone](http://www.soonr.com)

      1 Reply Last reply
      0
      • A Atul23

        Hi Friends, I have difficulties in getting handle of EditBox when I get the value of edit box. Following code is execute correctly when i set value to edit box CEdit *pOpenEdit = (CEdit *) GetDlgItem(IDC_FOLDER_PATH); if( NULL != pOpenEdit->GetSafeHwnd() ) { if( strOpenPath != "" ) pOpenEdit->SetWindowText(strOpenPath); } But when I want to get value of edit box , i did not get the handle of edit box. so it did not entered in if Block. CEdit *pOpenEdit = (CEdit *)GetDlgItem(IDC_FOLDER_PATH); if( NULL != pOpenEdit->GetSafeHwnd() ) { char buff[500]; pOpenEdit->GetWindowText(buff,256); strOpenLocation = buff; } So please let me know what is wrong in this code. Thanks in Advance Atul

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        How did you create it?

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups