| View previous topic :: View next topic |
| Author |
Message |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Mon Jul 28, 2008 3:57 pm Post subject: Listview problems |
|
|
Well, I can't ever get a Listview to show up on my Window. Here's my code to create a Listview control.
| Code: |
HWND hListview = CreateWindowEx(WS_EX_CLIENTEDGE, WC_LISTVIEW, "", WS_CHILD | WS_VISIBLE | LS_REPORT, 10, 10, 480, 180, IDC_MAIN_LISTVIEW, GetModuleHandle(NULL), NULL);
|
Nothing ever shows up though. _________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Mon Jul 28, 2008 4:42 pm Post subject: |
|
|
Did you initiate commctrl? _________________
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Mon Jul 28, 2008 5:21 pm Post subject: |
|
|
Yes. _________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Mon Jul 28, 2008 5:28 pm Post subject: |
|
|
Post your source or something so we can see everything. _________________
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Mon Jul 28, 2008 5:32 pm Post subject: |
|
|
| Code: |
#define IDC_MAIN_LISTVIEW;
#pragma comment(lib, "comctl32.lib")
INITCOMMONCONTROLSEX icc;
icc.dwSize = sizeof(INITCOMMONCONTROLSEX);
icc.dwICC = ICC_LISTVIEW_CLASSES;
InitCommonControlsEx(&icc);
case WM_CREATE: {
HWND hListview = CreateWindowEx(WS_EX_CLIENTEDGE, WC_LISTVIEW, "", WS_CHILD | WS_VISIBLE | LS_REPORT, 10, 10, 480, 180, IDC_MAIN_LISTVIEW, GetModuleHandle(NULL), NULL);
break;
}
|
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Mon Jul 28, 2008 9:53 pm Post subject: |
|
|
uhh...
IDC_MAIN_LISTVIEW <- no value
LS_REPORT <- doesnt exist (LVS_REPORT or 0x1)
hMenu parameter should be (HMENU)IDC_MAIN_LISTVIEW
ICC_STANDARD_CLASSES instead of just listview?? _________________
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Tue Jul 29, 2008 8:45 am Post subject: |
|
|
| lurc wrote: | uhh...
IDC_MAIN_LISTVIEW <- no value
LS_REPORT <- doesnt exist (LVS_REPORT or 0x1)
hMenu parameter should be (HMENU)IDC_MAIN_LISTVIEW
ICC_STANDARD_CLASSES instead of just listview?? |
Oops. I was typing this up instead of actually copy pasting my code. THe only thing copy pasted was CreateWindowEx.
And thanks cuz now it works.
EDIT:
Can't figure out how to use LVITEM. I don't get how to specify which column it goes under. _________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
|