How can I get the CheckedListBox for a Com project?

Hi, I'm developing a in process COM server to add prooperty pages to Active Directory. i'm using V.S. 2005's C++ with only the standard library.

When I create the GUI resource file for the property page, there is only standard listbox availble in the Toolbox. I know that checkedListBox is availble if I were developing a window application using VC++ from the toolbox. Does anyone know how I can get that added to my toolbox for this project

Thanks.




Answer this question

How can I get the CheckedListBox for a Com project?

  • Hemant Bhadane

    Read the docs please.

    LVM_INSERTITEM needs a LVITEM struct!



  • greentub

    There is a checkedListBox in VC++ toolbox when you develop windows application. But mayb underneach, that is also a subclass. What is AFAIK THANK YOU FOR YOU HELP.

  • Jason Bentley

    Can you point me to some more information on how I can subclass to create a control in C++ Will this becconsidered as a user-drawn control Thanks.

  • feilng

    AFAIK= As Far As I Know.

    I have no such control in my toolbox.

    Before I can give you further hints: Are you using managed C++ or C++/CLI or native Win32 programming (ATL/MFC)



  • Andrey Shur

    The list view is named "List Control" in the dialog editor.

  • Peter Nimmo

    Create a normal Listbox and subclass the ListBox with CCheckListBox. There is no plain control for a checked listbox. AFAIK the listbox style must be owner drawn variable.



  • Jameer

    So the CCheckListBox class is part of the MFC. If you are not using this too, you have to use a List Ctron with the checkbox style.

  • k mac

    Oh, that's great! Thank you.

    I founda ListView control by right click on my Toolbox and select the choose an item. I clicked on the COM tab and added a ListView control and am now coding to send it the Checkbox style. I hope this work. If not then I'll use the list contol. Thank you very much for your help.



  • Crystalz

    It wrote it two times. Its a MFC class, so if you do not use the MFC you cant use it. If you use the MFC just search for CCheckListBox otherwise you can use a list view with LVS_EX_CHECKBOXES (just search the MSDN for it).

  • Andres G

    I'm using unmanaged C++ and only Win C++ standard library. This is because the ext. property sheets that I'm developing for Active Directory has to run on Win 2000 server and it only takes MMC 1.2 and my V.S. 2005 and .net Framework 2.0 won't work directly with that (sigh...). I thought about and tried using COM interop but there's not enough information on the internet or examples so I gave up after 2 weeks and go back to using C++.

    Cheers.



  • Milt Lynd

    OK, in this COM, AD property sheet that I'm developing. The resource file, GUI, is a dialog and I only get Dialog Editor tool. How do I get a ListBox control with a Checkbox style tool in this environment Thanks.

  • BugOrFeature_quest

    Hi Martin,

    I inserted the List Control onto my Dialog and then sent the following message to add item but it's not working. Are you sure the List Control is the same as List View Thanks.

    _bstr_t contextName(bstr);

    LPCWSTR lpcContext = contextName;

    wchar_t *wContext = contextName.operator wchar_t *();

    ::MessageBox(NULL, lpcContext, L"lpcContext; Unity - PopulateCheckedListBox", MB_OK);

    const char* contexts = contextName.operator const char *();

    //ListView_InsertItem(hwndListView, LPTSTR pszText)

    //lResult = SendDlgItemMessage(hwndDlg, IDC_LIST_CONTEXTS, LVM_INSERTITEM ,-1,(LPARAM)(contexts));

    lResult = SendDlgItemMessage(hwndDlg, IDC_LIST_CONTEXTS, LVM_INSERTITEM ,-1,(LPARAM)(LPCSTR)(wContext));

    if(lResult <= 0)

    {

    DisplayError( hResult, L"Fail to insert context into listview.; Unity - PopulateCheckedListBox" );

    hResult = E_FAIL;

    //goto Cleanup;

    }//end if(lResult <= 0)



  • rioja

    Thank you for the reply agai Martin, but I don't have ListView control availabe in my toolbox in the Dialog Editor either. What can I do now Thanks.

  • How can I get the CheckedListBox for a Com project?