Retrieving strings from a listbox
I'm having a major problem retrieving strings from a listbox and i don't have a clue as to what's wrong. Actually, i know exactly what's wrong but i don't know why it is. Anyways, here's the code segment:
As you can see i'm trying to extract a string - specifically a file path - and then reading the file. The problem is that it doesn't even get to there! After running this through the debugger, when it hits the SendMessage line, it gives an error for the value hList, stating:
HWND hList = GetDlgItem(hwnd, IDC_LIST1);
count = SendMessage(hList, LB_GETCOUNT, 0, 0);
while(count >= 0)
SendMessage(hList, LB_GETTEXT, count, (LPARAM)buf);
fpROM = fopen(buf, "rb");
I have NO idea why this is since i've used SendMessage before without error and SendMessage expects a HWND as the first argument.
unused CXX0030: Error: expression cannot be evaluated.
I'm totally stumped, any ideas??