LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Out of memory using InsertListItem(....)

Hi,
 
The listed source result in a :
 NON-FATAL RUN-TIME ERROR:   "NaviLightsSignalsGUI.c", line 46, col 13, thread id 0x00000728:   Library function error (return value == -12 [0xfffffff4]). Out of memory
#define PREDEFINED_TEXT_NAME  "text_"
#define NO_OF_CARD     49
char gPictureFileName[256];
int gPanelHandle, i;
 for (i=1; i<= NO_OF_CARD; ++i) {
  sprintf(gPictureFileName, "%s%d.jpg", PREDEFINED_TEXT_NAME, i);
  InsertListItem(gPanelHandle, PANEL_PICTURERING, -1, gPictureFileName, 0);
 }

The question is why and how to overcome this issue?
 
Regards
EGO
0 Kudos
Message 1 of 3
(3,302 Views)

One possible reason could be that you are passing a .jpg file whereas the picture ring control accepts only bitmap images. You could try to use GetBitmapFromFile to retrieve the bitmap out of you jpeg files and SetCtrlBitmap instead of InsertListItem: according to SetCtrlBitmap online help:

For picture rings, you can use this function instead of ReplaceListItem. To add a new entry, first call InsertListItem with a NULL value and then call SetCtrlBitmap.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 3
(3,282 Views)

Thank you for the answer,

I will try it ASAP

Regards

EGO

0 Kudos
Message 3 of 3
(3,275 Views)