Hi guys,
I'm new to programming in windows so I thought I'd write a simple program to start me off.
I have this code:
Code:
HWND hList;
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {
/* snip */
hList = CreateWindowEx(
LVS_EX_FULLWORSELECT | WS_EX_CLIENTEDGE, WC_LISTVIEW, TEXT(""),
WS_VISIBLE | WS_CHILD | LVS_REPORT,
150, 10, 550, 300,
hwnd, (HMENU)ID_LISTVIEW, hInstance, NULL);
if(!hList)
exitError();
/* snip */
That code works fine on Windows XP (I'm sure it works on most other windows platforms too). hInstance is externally declared and it is the instance of the main window used with RegisterClass().
Now, when I plug in a network cable and run the program, I get error 1400 Invalid Window Handle, but only when I have WC_LISTVIEW there, if I make it TEXT("BUTTON") or something else it is displayed.
I don't understand what is going on, it's all weird. I don't have any network code at all, just CreateWindow() 's and that's it. I have some MySQL backend code in there, but I've taken it out for the time being to see if it was that causing it.
Any help would be greatly appreciated
Daniel