CComboBox::SetItemDataPtr and cleaning memory
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: CComboBox::SetItemDataPtr and cleaning memory

  1. #1
    Join Date
    Mar 2010
    Posts
    37

    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 offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,524

    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
    Location
    Timisoara, Romania
    Posts
    14,360

    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

This is a CodeGuru survey question.


Featured


HTML5 Development Center