CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2010

    CComboBox::SetItemDataPtr and cleaning memory

    If I allocate memory for a combobox item and store the pointer with SetItemDataPtr, does DeleteString liberate the allocated space automatically or do I have to do it manually ? Same question when the CComboBox object is destroyed. I didn't find the answer in MSDN.

  2. #2
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Hanover Germany

    Re: CComboBox::SetItemDataPtr and cleaning memory

    Combobox has no idea what kind of objects did you aloocated (if any) and how (in the heap, on the stack,...)
    So it is up to you to cleanup by DeleteString and/or destroying control.
    Victor Nijegorodov

  3. #3
    Join Date
    Oct 2002
    Timisoara, Romania

    Re: CComboBox::SetItemDataPtr and cleaning memory

    No, the control does not do any auto-clean-up. You must handle that manually.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.