How to get all checked items from TreeView in VC++ mfc

void CPDlg::OnTreeClk(NMHDR *pNMHDR, LRESULT *pResult)
NMTREEVIEW& nm = *(LPNMTREEVIEW)pNMHDR;
// which item was selected?
HTREEITEM hItem = m_columnTree.GetTreeCtrl().GetSelectedItem();
temp = m_columnTree.GetItemText(hItem, 0);
MessageBox(temp);
if (!hItem) return;
// the rest of processing code..
I'm new in VC++ .
this code gives only current selected item . but i need to get all checked items from treeView.
kindly help me..

no not unchecked .. the all check box's gone from tree view. which means Treeview without check box.
finally i tried SetCheck 
void CPracticesDlg::OnSelchangedTreectrl(NMHDR* pNMHDR, LRESULT* pResult)
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
// TODO: Add your control notification handler code here
tree_state = 1;//changed
HTREEITEM hItem = m_columnTree.GetTreeCtrl().GetSelectedItem();
BOOL chk = m_columnTree.GetTreeCtrl().GetCheck(hItem);
if (chk == TRUE)
HTREEITEM hmyItem = m_columnTree.GetTreeCtrl().GetSelectedItem();
// Check all of the children of hmyItem.
if (m_columnTree.GetTreeCtrl().ItemHasChildren(hmyItem))
HTREEITEM hNextItem;
HTREEITEM hChildItem = m_columnTree.GetTreeCtrl().GetChildItem(hmyItem);
while (hChildItem != NULL)
hNextItem = m_columnTree.GetTreeCtrl().GetNextItem(hChildItem, TVGN_NEXT);
m_columnTree.GetTreeCtrl().SetCheck(hChildItem, 1);
hChildItem = hNextItem;
else
HTREEITEM hmyItem = m_columnTree.GetTreeCtrl().GetSelectedItem();
// Uncheck all of the children of hmyItem.
if (m_columnTree.GetTreeCtrl().ItemHasChildren(hmyItem))
HTREEITEM hNextItem;
HTREEITEM hChildItem = m_columnTree.GetTreeCtrl().GetChildItem(hmyItem);
while (hChildItem != NULL)
hNextItem = m_columnTree.GetTreeCtrl().GetNextItem(hChildItem, TVGN_NEXT);
m_columnTree.GetTreeCtrl().SetCheck(hChildItem, 0);
hChildItem = hNextItem;
code works good . but here is i think small problem . i cant find it.
when i click the root node it goes to checked state but not child node. again i click same root node it goes to unchecked state but all child's are goes to checked state.
help me. here what is the problem?

Similar Messages

  • How to get all checked values from a chaeck box

    Hello
    In my app i have a checkbox called P10_CID with static lov like
    STATIC2:one;1,two;2,three;3,four;4,six;6
    my question is when i check more than one option
    i can not get that value.
    How is it possible to see all the values of the check box that are checked ?
    Regards
    Aris

    Hi Aris,
    Do you have to have checkboxes? Can you use a multiselect list instead?
    If you can, then the following excerpt from the user guide may help you:
    Using HTMLDB_UTIL.STRING_TO_TABLE to Convert Selected Values
    Suppose you had a report on the EMP and DEPT tables that is limited by the
    departments selected from a Department multiple select list. First, you create the
    multiple select item, P1_DEPTNO, using the following query:
    SELECT dname, deptno
    FROM dept
    Second, you return only those employees within the selected departments as follows:
    SELECT ename, job, sal, comm, dname
    FROM emp e, dept d
    WHERE d.deptno = e.deptno
    AND instr(':'||:P1_DEPTNO||':',':'||e.deptno||':') > 0
    Regards
    Andy

  • How to get all the values from the dropdown menu

    How to get all the values from the dropdown menu
    I need to be able to extract all values from the dropdown menu; I know how to get all those values as a string, but I need to be able to access each item; (the value in a dropdown menu will change dynamically)
    How do I get number of item is selection dropdown?
    How do I extract a ?name? for each value, one by one?
    How do I change a selection by referring to particular index of the item in a dropdown menu?
    Here is the Path to dropdown menu that I'm trying to access (form contains number of similar dropdowns)
    RSWApp.om.GetElementByPath "window(index=0).form(id=""aspnetForm"" | action=""advancedsearch.aspx"" | index=0).formelement[SELECT](name=""ctl00$MainContent$hardwareBrand"" | id=""ctl00_MainContent_hardwareBrand"" | index=16)", element
    Message was edited by: testtest

    The findElement method allows various attributes to be used to search. Take the following two examples for the element below:
    <Select Name=ProdType ID=testProd>
    </Select>
    I can find the element based on its name or any other attribute, I just need to specify what I am looking for. To find it by name I would do the following:
    Set x = RSWApp.om.FindElement("ProdType","SELECT","Name")
    If I want to search by id I could do the following:
    Set x = RSWApp.om.FindElement("testProd","SELECT","ID")
    Usually you will use whatever is available. Since the select element has no name or ID on the Empirix home page, I used the onChange attribute. You can use any attribute as long as you specify which one you are using (last argument in these examples)
    You can use the FindElement to grab links, text boxes, etc.
    The next example grabs from a link on a page
    Home
    Set x = RSWApp.om.FindElement("Home","A","innerText")
    I hope this helps clear it up.

  • How to get all the values from a HashMap? thanks

    hi
    can anyone tell me how to get all the keys and their values contained in a HashMap? thanks

    thanks to u all for ur response, i gues if i need to get both keys and values, i need to use keySet() to get a set of keys first and then using each key to get value. is there any other faster way to get both of them (key and value)? thanks again

  • How can I get the checked item from a list that is generated automatically?

    I am still pretty new a CF and could really use some help. I am trying to get each item that is checked from a page that generates the list automatically from a query and get the associated textbox text with it. For example:
                        <!--- Start Get Data Hierarchy List--->
                                  <cfquery datasource="MyDatasource" name="qry_GetData">
                                            SELECT C.taxonomy_id, C.lvl, C.taxonomy_name, C.taxonomy_tree, C.taxonomy_guid, C.taxonomy_standard_name
                                            FROM dbo.taxonomy AS P
                                            JOIN dbo.taxonomy AS C
                                                      ON P.taxonomy_id = 21
                                                      AND C.hid.IsDescendantOf(P.hid) = 1
                                                      AND C.lvl = 3
                                  </cfquery>
                        <!--- Start Get Data Hierarchy List--->
    <cfloop query="qry_GetData">
    <input type="checkbox" name="cbox_PE_SelTax#taxonomy_id#" value="#taxonomy_name#"><font size="4" color="3399FF"> #taxonomy_name#</font>
    <br />
         - Details of experience with #taxonomy_name#:<input name="tbox_PE_SelTax#taxonomy_id#" id="tbox_PE_SelTax#taxonomy_id#" size="50%">
    <br />
    <br />
    </cfloop>

    Dave,
    Thank you for your help so far. I must not be asking the right question. Here is the whole breakdown. I am writing this page to collect the users information, Name, Title, Company, and technologies they are familiar with. I then want that information emailed to me upon submission. The point I am running into a problem (even with your last post) is how to write the action part of it that will email the checked items to me. I cannot figure out if I need to use CFLOOP (if so, how) or what the best method is. I am a very visual lerner and can understand how code works easily, but I have not found any examples for my situation. Again, I really appriciate all of your help thus far.
    Thank you!

  • How to get all image files from a folder to wwv_flow_files?

    Hi there!
    Is it possible in apex to show, in a report look-a-like, all image filenames from a folder in another machine (i enter in that machine by ip) and insert all files into wwv_flow_files?
    I want to see all files, then pick one and open a image...
    But it can't be by browse item... it has to show all filenames as a list...
    If it is possible, how can i do it?
    Thanks!
    Best regards,
    Luis Pires

    Hi,
    you can connect to the server using UTL_HTTP.
    Then for each files you copy the response into a BLOB to be able to show it or to store it in a table.
    A piece of code :
    begin
       -- initialize the BLOB.
       dbms_lob.createtemporary(l_blob, false);
       -- path to the file
       l_url := 'http://your_server/your_file.jpg';
       -- begin retrieving the target.
       l_req := utl_http.begin_request(l_url);
       -- identify ourselves (some sites serve special pages for particular browsers)
       utl_http.set_header(l_req, 'User-Agent', 'Mozilla/4.0');
       -- start receiving the response.
       l_resp := utl_http.get_response(l_req);
       -- copy the response into the BLOB.
       begin
          loop
             utl_http.read_raw(l_resp, l_raw, 32767);
             dbms_lob.writeappend (l_blob, utl_raw.length(l_raw), l_raw);
          end loop;
          -- stop when exception end_of_body is raised
       exception
          when utl_http.end_of_body then
             utl_http.end_response(l_resp);
       end;
    end;It's a minimal example, you may need authentication, check l_resp.status_code, etc...

  • How to get the selected items from listbox

    Regarding listbox i have two questions
    1) I want to get the selected items as per the order in which ihave selected.Presently i'm getting in the ascending order.For example after selcting the 1,2,6 if i select 3 then its giving 1,2,3,6.But i want it in the order 1,2,6,3
    2)I want to select items from a single list box to many other listboxes.(ie) my first selection should goto first,second one to the second listbox and like this.How should i write the logic.
    please give me a suggestion.

    In order to have the selected items line up in accordance to the selection order, please do it one at a time. (That's the limit for that VI)
    If you need more than that (i.e. to regconize which item clicked first and which one comes later), you may have to figure it out ya
    Wish you good luck. Perhaps, someone else has a already made vi.
    Cheers!
    ian.f
    Ian F
    Since LabVIEW 5.1... 7.1.1... 2009, 2010
    依恩与LabVIEW
    LVVILIB.blogspot.com

  • How to get all menu items list in blackberry curve phone

    Hai all
    i am new to Blackberry application developer. I done one application in blackberry in default simulaor, I changed my simulator to Blackberry 8900 simulator. The features is more in curve phones like instant messaging. So i need to get the full menu item list from the API. Do i neddd to change the API ?..  I wanted to get the list like .. camera,maps,contacts,messages,weblin,sms,instant messaging etc. Can anyone help me in this case. My intention to get all the menu items in a list.
    Thanks in Advance

    thank you for your solution.. my aim is list all the menu items in a drop down list. In the default simulator it is fetching all the menu items in the phone through API. But in curve 8900 it is not showing all the menu items, can u give me a suggestion
    like           ^
    camera
    contacts
    maps
    clock
    calendar  like this i need to display
    Message Edited by joedfranc on 05-30-2009 10:57 AM

  • How to get all the fieldnames from a tcResultSet

    Hi, im coding a connector to write to a file all the fields of the process form.
    to be like this:
    User ID: value for UserID
    FirstName: Value for first Name
    LastNAme: Value for LastName
    Im using the Process instance Key to get the tcResultSet.
    I know if I give an array or a hardcoded list of fieldnames, i can get the field values.
    like this
    String fieldname = "FORM_UDF_USR_ID";
    String Response = formData.getStringValue(fieldName);
    my question is, how can i get a list of fieldnames from the tcResultSet so i dont need to provide it
    something like
    formdata.getFieldlist(); ?
    Thank You.

    Here is the algo
    * Description : Prints the tcResultSet
    * @param rs tcResultSet
    * @throws tcAPIException
    * @throws tcColumnNotFoundException
    * @throws Exception
    public void printResultSet(tcResultSet rs) throws tcAPIException, tcColumnNotFoundException {
    String methodName = "printResultSet";
    print "COUNT = " + rs.getRowCount());
    String[] cols = rs.getColumnNames();
    for (int i = 0; i < rs.getRowCount(); ++i) {
    rs.goToRow(i);
    for (int j = 0; j < cols.length; j++) {
    if (cols[j].indexOf("Row Version") == -1) {
    print cols[j] + "\t\t:"
    + rs.getStringValue(cols[j]));
    Try this , replace print by System.out.println

  • How to reference all service item from Contract for PO creation

    In standard SAP cannot reference the contract service to PO automatically,
    I'm trying to develop the BADI or user exit,
    The problem is where to set_data for service tab data in  BADI ME_PROCESS_PO_CUST
    In if_services_mm only has method get_srv_data, no set_srv_data

    IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM
      SELECT * FROM ML_ESLL APPENDING TABLE SERVICE
                          WHERE EBELN = l_item-konnr
                          AND   DEL    EQ SPACE.
      lr_po_item_handle ?= im_item.
      LOOP AT SERVICE INTO l_service.
        set the service numbers and  and other fields in the contract to l_item. 
      ENDLOOP.

  • Get all the objects from an application

    Hi
    Does anybody know how to get all the expression from an application via ABAP?
    Thanks !

    Try this:
    * Get the BRFplus factory and query.
      lo_factory = cl_fdt_factory=>get_instance( ).
      lo_query = lo_factory->get_query( ).
    * Get Application id.
      lo_query->get_ids(
        EXPORTING
          iv_name        = p_appln
          iv_object_type = if_fdt_constants=>gc_object_type_application
        IMPORTING
          ets_object_id  = lt_id_application ).
      READ TABLE lt_id_application INTO lv_id_application
                 INDEX 1.
    * Build selection.
      ls_selection-queryfield = if_fdt_admin_data_query=>gc_fn_application_id.
      ls_selection-sign   = 'I'.
      ls_selection-option = 'EQ'.
      ls_selection-low    = lv_id_application.
      INSERT ls_selection INTO TABLE lt_selection.
      ls_selection-queryfield = if_fdt_admin_data_query=>gc_fn_object_type.
      ls_selection-sign   = 'I'.
      ls_selection-option = 'EQ'.
      ls_selection-low    = if_fdt_constants=>gc_object_type_expression.
      INSERT ls_selection INTO TABLE lt_selection.
      ls_object_category_sel-customizing_objects = abap_true.
      ls_object_category_sel-masterdata_objects  = abap_true.
      ls_object_category_sel-system_objects      = abap_true.
    * Perform selection.
      lo_query->select_data(
        EXPORTING
          its_selection          = lt_selection
          is_object_category_sel = ls_object_category_sel
        IMPORTING
          eta_data               = lt_id_expression ).
    * Process the Expressions.
      LOOP AT lt_id_expression INTO lv_id_expression.
    *   Get Expression object.
        lo_expression = lo_factory->get_expression( lv_id_expression ).
    *   Check Expression is not deleted or obsolete.
        lo_expression->if_fdt_admin_data~get_change_info(
          IMPORTING
            ev_deleted           = lv_flg_deleted
            ev_marked_for_delete = lv_flg_marked_for_delete
            ev_obsolete          = lv_flg_obsolete ).
        IF lv_flg_deleted           EQ abap_true OR
           lv_flg_marked_for_delete EQ abap_true OR
           lv_flg_obsolete          EQ abap_true.
          CONTINUE.
        ENDIF.
    *   Process the Expression.
        lv_name_expression = lo_expression->if_fdt_admin_data~get_name( ).
        WRITE: / lv_id_expression, lv_name_expression.
      ENDLOOP.
    Regards,
    Grogan

  • How to get ALL command line parameters

    Hi,
    Is there possibility to get all command line parameters which
    Flex builder invokes when I press RUN button ?
    I am asking because I want to create mxmlc ant task with the
    same parameters as Flex builder.
    I wrote something like that below but I have a problem with
    invoking remote function, it seems that poduced SWF inf flex
    builder an my script (below) arent the same - and mayby have some
    security differences.
    Any Ideas how to get all compiler argumets from flex builder
    quote:
    <mxmlc
    file="${flex.src}\main.mxml"
    output="${flex.output}\main.swf"
    services="${path.tomcat.root.WEB}/flex/services-config.xml"
    context-root="${path.tomcat.root}"
    use-network="true"
    keep-generated-actionscript="false"
    debug="false"
    locale="en_US"
    incremental="true"
    >
    <!--load-externs="${LOADEXTERNS}"
    link-report="link-report.xml" -->
    <load-config
    filename="${FLEX_HOME}\frameworks\flex-config.xml"/>
    <source-path path-element="${FLEX_HOME}\frameworks"/>
    <compiler.source-path path-element="${flex.src}"/>
    <compiler.library-path dir="${FLEX_HOME}\frameworks"
    append="true">
    <include name="libs" />
    <include name="../bundles/{locale}" />
    </compiler.library-path>
    </mxmlc>

    Hi,
    Try -dump-config compiler argument, which will write all the
    currently set configuration values. Please find more details at the
    URL below.
    http://www.quilix.com/node/9
    Hope this helps.

  • The user acct my apple was connected to no longer works (corrupt).  My Apple TV is still synced to that account and all of my recent purchases are going to that username.  Does anyone know how to get all of the purchased items back and to the new user?

    The user profile my appleTV was synced on my computer to no longer works (corrupt).  My Apple TV is still synced to that profile and all of my recent purchases are going to that username.  Does anyone know how to get all of the purchased items back and to the new user (same computer)?  I created a new user on my computer and moved the itunes folder to the desktop but never changed the path to which the apple synced to.  Now I can only see old items I purchased before the user profile went bad.  PLease help!

    Welcome to the Apple Community.
    Changing the library the Apple TV is synced with will delete all synced content from the Apple TV, but it won't delete purchased content.
    You should be able to change the library, resync any content you want and transfer your purchases back to the new library.

  • How to get all INDEXes from a database

    How to get all INDEXes in a database? I need to store them in script file (.SQL). My database version is 10.2.0.3.0.
    Edited by: Iniyavan on Sep 18, 2009 1:39 PM

    --Thanks, Koppelaars. The second query works. But I'm unable to store in spool file. May be it's due to CLOBs in the output. I did the following:
    set head off
    set feedback off
    set linesize 32727
    set pagesize 50000
    spool c:\indexes.sql
    select dbms_metadata.get_ddl('INDEX',INDEX_NAME,'MYSCHEMA')
    from user_indexes;
    spool off
    --In the spool file, I find only this
    CREATE UNIQUE INDEX "MYSCHEMA"."A" ON "MYSCHEMA"."BNK_DEALID" ("DEAL_ID")
    PCTF
    CREATE INDEX "MYSCHEMA"."ACCENT_RAC_REPORT" ON "MYSCHEMA"."ACCENT" ("SCHEME", "VAL
    CREATE INDEX "MYSCHEMA"."ACCENT_REPORT" ON "MYSCHEMA"."ACCENT" ("SCHEME", "APP_REF
    CREATE UNIQUE INDEX "MYSCHEMA"."ACCENT_X" ON "MYSCHEMA"."ACCENT" ("DEAL_ID")
    P
    CREATE UNIQUE INDEX "MYSCHEMA"."ACCNAV_X" ON "MYSCHEMA"."ACCNAV" ("SCHEME", "ACCNA
    --How to get all the DMLs in one SQL file?
    --Nagappan, I'm using WIN.

  • How to get all data from nokia to i5s

    how to get all data from nokia E71 to i5s???

    if you can put those data in your computer then add it in iTunes. your iPhone 5s should get it thru syncing.

Maybe you are looking for