Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

TLMDChecklistComboBox - Cannot assign a TBitmap to a TListBoxStrings

Any idea as to what might cause this error other than the obvious?
The line of code is:
pCombo.Items := TPicklistItem(gCurPicklist[iPicklist]).Members;
where the Members property is a TStringList.

Cannot assign a TBitmap to a TListBoxStrings.


[00448CDF]
Classes.TPersistent.AssignError
[00448D15]
Classes.TPersistent.AssignTo
[00B26621]
LMDCheckListComboBox.TLMDCheckListComboBox.SetItems

Comments

  • 6 Comments sorted by Votes Date Added
  • While I've not been able to reproduce the TBitmap error but customers have, I think it might be related to several memory leaks associated with the CreateButtonData function, and if I repeat this loading of the combo box, it might eventually hit this error.  Please see the EurekaLog reports below concerning memory leaks just loading the combo 3 or 4 times I think it was.  This is something I need fixed ASAP... so if you have a getaround rather than wait for the next release, I would appreciate it highly :)

    |+Leak #3: Type=TLMDButtonListData; Total size=888; Count=74                                                                             |
    |----------------------------------------------------------------------------------------------------------------------------------------|
    |00000002|03     |00000000|007CA510|WsprRptr.exe|003CA510|LMDCustomCheckListBox|TLMDCustomCheckListBox|CreateButtonData      |           |
    |00000002|03     |00000000|00449A2B|WsprRptr.exe|00049A2B|Classes              |TStrings              |Assign                |           |
    |00000002|03     |00000000|007CB651|WsprRptr.exe|003CB651|LMDCheckListComboBox |TLMDCheckListComboBox |SetItems              |           |

    |+Leak #4: Type=TLMDButtonListData; Total size=12; Count=1                                                                               |
    |----------------------------------------------------------------------------------------------------------------------------------------|
    |00000002|03     |00000000|007CA510|WsprRptr.exe|003CA510|LMDCustomCheckListBox|TLMDCustomCheckListBox|CreateButtonData      |           |
    |----------------------------------------------------------------------------------------------------------------------------------------|

    |+Leak #5: Type=TLMDButtonListData; Total size=12; Count=1                                                                               |
    |----------------------------------------------------------------------------------------------------------------------------------------|
    |00000002|03     |00000000|007CA510|WsprRptr.exe|003CA510|LMDCustomCheckListBox|TLMDCustomCheckListBox|CreateButtonData      |           |
    |
  • I've found a quick "get-around".  On my formDestroy event that contains the combo, I simply do an Items.Clear on the TLMDCheckListComboBox.  This might be missing in your destroy event for that control.
  • I do see one flaw in my code which might have something to do with the TBitmap situation, but not the memory leak.
    Changed:
    pCombo.Items := TPicklistItem(gCurPicklist[iPicklist]).Members;
    to:
    pCombo.Items.Assign(TPicklistItem(gCurPicklist[iPicklist]).Members);

  • The bug has been fixed. But the fix is not one-two lines of code. So, I can send you modified sources if you provide your e-mail (you can write to our support e-mail).
  • Seems ok now that I fixed my assignment line and added the items.clear in the form destroy event.  So seems I can wait until the next release.
Sign In or Register to comment.