|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Hi,
Ive got a linked list structure which contains a command structure. Oviously internally my program stores it in its own datastructure but externally it takes the form of english looking commands such as Mouse(x,y,button). I need to walk this list and display the contents into a Edit control to enable the user to view it. I have a function which returns the command as a char * (english style). However I dont know how many commands are present and I cant seem to append items to the edit control (WIN32/c only no mfc). So I thought why not read it all into a string and then send it in one go. However since I dont know the total size before hand it will prob mean assigning memory on the fly. I know about malloc/free but how can I repeatdly do this in a loop or is there a way to append to a edit control instead of adding it in one big char chunk? Thanks your views and ideas would be welcomed. Ta |
|
#2
|
|||
|
|||
|
for allocating more memory to an already assigned variable, you can use realloc() to extend the space.
i am no pro in windows programming, but i remember there is a WM_GETTEXT message which should help you in appending. since this comes back to using #1, you should use one string and write it once to the edit control.
__________________
-- Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > C Programming > Best way to memory alloc/display? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|