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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CComboBox and Loading directories

CComboBox and Loading directories

Scheduled Pinned Locked Moved C / C++ / MFC
help
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
    athick
    wrote on last edited by
    #1

    My application needs that i use a ComboBox and ListBox.The ComboBox will display a drive or directory in the system and my listbox will display all the subdirectories.This comboBox and listbox get displayed in a Dialog application. There is a function called CWnd::DlgDirListComboBox .As per documentation this is supposed to load a directory. there are 2 classes in my application CForDialog and CForApp . I used this line of code inside InitDialog in CForDialog class .......throws unhandled exception this->DlgDirListComboBox(_T(""),IDC_COMBO1,IDC_LIST1,DDL_DIRECTORY|DDL_EXCLUSIVE); can u help :confused:

    S I 2 Replies Last reply
    0
    • A athick

      My application needs that i use a ComboBox and ListBox.The ComboBox will display a drive or directory in the system and my listbox will display all the subdirectories.This comboBox and listbox get displayed in a Dialog application. There is a function called CWnd::DlgDirListComboBox .As per documentation this is supposed to load a directory. there are 2 classes in my application CForDialog and CForApp . I used this line of code inside InitDialog in CForDialog class .......throws unhandled exception this->DlgDirListComboBox(_T(""),IDC_COMBO1,IDC_LIST1,DDL_DIRECTORY|DDL_EXCLUSIVE); can u help :confused:

      S Offline
      S Offline
      Skarrin
      wrote on last edited by
      #2

      You must not give a constant string as path spec :mad:: " lpPathSpec Points to a null-terminated string that contains the path or filename. DlgDirListComboBox modifies this string, which should be long enough to contain the modifications. For more information, see the following “Remarks” section. " HTH, Jens

      1 Reply Last reply
      0
      • A athick

        My application needs that i use a ComboBox and ListBox.The ComboBox will display a drive or directory in the system and my listbox will display all the subdirectories.This comboBox and listbox get displayed in a Dialog application. There is a function called CWnd::DlgDirListComboBox .As per documentation this is supposed to load a directory. there are 2 classes in my application CForDialog and CForApp . I used this line of code inside InitDialog in CForDialog class .......throws unhandled exception this->DlgDirListComboBox(_T(""),IDC_COMBO1,IDC_LIST1,DDL_DIRECTORY|DDL_EXCLUSIVE); can u help :confused:

        I Offline
        I Offline
        Irgi
        wrote on last edited by
        #3

        The Directory Path must not be a static path in DlgDirList-Method! Sample: IDC_LIST1 is the box to be filled... CString *temp1 = new CString("c:\\tmp\\style\\*.xsl"); LPTSTR str1 = temp1->GetBuffer(temp1->GetLength()); int ret=this->DlgDirList(str1,IDC_LIST1,0,0);

        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