Ok, this is sort of a different question than I already asked so I gave this it's own thread.
I have a listbox and some code I wrote for linked list functions.
I have been getting problems left and right with trying to use a function that accepts a pointer to a linked list and a number referring to the structure on the stack and reads a data structure in my list and gives a pointer back to the specific data structure. Nothing but problems. If I run this code in a console program it runs fine, but when I run it in my Win32 API program it crashes. If I delete the function call it doesn't crash.
I want to try a different approach.
So here is my question.
When appending an item to a listbox like this:
SendDlgItemMessage(hwnd, IDC_MYLIST, LB_ADDSTRING, 0, (LPARAM)string);
I know that you can also call SetDlgItemMessage with LB_SETITEMDATA and add a pointer to extra data related to the item in the listbox.
I have a structure with frame data for an animation and want to be able to link it up with my items in my listbox, so when an item is deleted the data is deleted. If an item is added, the data will be added. Simple, right?
Well here is the structure I have:
How would I do the following:Code:struct framelist { char *filepath; char *filename; int delay; int loop; int xpos; int ypos; struct framelist* next; }; struct framelist *mainframeset;
Add item to listbox with a pointer to a list in a linked list using that structure? I already have the code to append/delete an item from the list.
Let's just say my functions are:
Any help is appreciated. Thanks in advance, I am sure someone out there will have a quick solution for this.Code:struct framelist *Append(struct framelist *node, int data); void Delete(struct framelist *node, int itemnum);