LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

proper use of Programmer's Toolbox List functions

I have a structure called struct structTest. At the bottom of the definition I assign a name called strSCmember. It consists of a bunch of ints and some strings. At some point in my code, I am populating the structure, and then getting a pointer to the structure and inserting that pointer into a List with ListInsertItem. I am able to search the list with ListFindItem which works fine. I am worried that I have not allocated memory for this node of the list. Now I want to add another node, so I modify the values in the structure, get a pointer to it, and do a ListInsertItem(). Is the system automatically allocating memory for this node, and if so, how do I free it after I do a ListRemoveItem()?
0 Kudos
Message 1 of 2
(2,605 Views)
Hello

You dont really need to worry about allocating memory for the list, the API should take care of it for you. Check out the example thta demonstrates the use of the List API, you can find it under .\CVI\samples\toolbox. This should give you an idea of how to use the list.

I hope this helps. Let me know if I missed anything.

Thanks

Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 2 of 2
(2,605 Views)