So here is my problem, i have a CtrlList
, and I want to insert items via PostMessage
(asyncron) therefore the message LVM_INSERT_MESSAGE
, is going to be processed when it is his turn, but the problem is i need to allocate memory for LVITEM
, so that i don't loose it before i insert the item. But after i loose the pointer to the allocated item after exiting the function. And since insert item creates another item, i find it hard to deallocate the memory i allocate for LVITEM
.
My solution was since LVM_INSERT_MESSAGE
sends LVN_INSERT_MESSAGE
notification, on that notification to call a function, but the only way to get the lvitem is throw an lparam, but on_notify has (NMHDR *pNMHDR, LRESULT *pResult
) parameters. Can you give me a solution for deallocating that memory, i must insert it with postmessage, don't tell me to use send message or the function insertitem . Thank you.