Skip to main content
GameDev.net gamedev.net
🔒 Locked

[Solved] [Win32] List View?

Started by by Jun 30, 2006 at 7:10 PM 8 replies 2.5k views
Original Post
by
by
Hi, I am working on a simple Win32 program that has got a list view control. Program works well on my computer. But on friends computer the dialog with list view doesn't show up. There is no errors no nothing! But it does not showing up. Even on computers that have MSVS2003 installed. MSVC++ .net 2003, NOT MFC, Windows XP Pro. [Edited by - by on July 2, 2006 5:03:13 PM]
Colin Jeanne
Colin Jeanne
If you cant get a debugger on your friend's computer then try using a logging system. Errors are occuring, you're just not reporting them.
by
by
Yes i tried both.

InitCommonControlsEx() call causes an error that i dont understand:
INITCOMMONCONTROLSEX icex;// Ensure that the common control DLL is loaded. icex.dwSize = sizeof(INITCOMMONCONTROLSEX);icex.dwICC  = ICC_LISTVIEW_CLASSES;InitCommonControlsEx(&icex); 

Kapampg2 error LNK2019: unresolved external symbol __imp__InitCommonControlsEx@4 referenced in function "int __cdecl InitInstance(struct HINSTANCE__ *,int)" (?InitInstance@@YAHPAUHINSTANCE__@@H@Z)


I tried a log system and log ends when the dialog with list view or tree view inited.
by
by
I tried a example win32 project with a dialog that has a rich edit. Same think occured on my computer. The dialog didn't show up. Please help :(

I find this in msdn:
HWND CreateListView (HWND hwndParent) {     HWND hWndListView;    RECT rcl;     INITCOMMONCONTROLSEX icex;        // Ensure that the common control DLL is loaded.     icex.dwSize = sizeof(INITCOMMONCONTROLSEX);    icex.dwICC  = ICC_LISTVIEW_CLASSES;    InitCommonControlsEx(&icex);         // Create the list-view window in report view with label editing enabled.    GetClientRect (hwndParent, &rcl);         hWndListView = CreateWindow(WC_LISTVIEW,                                 "",                                 WS_CHILD | LVS_REPORT | LVS_EDITLABELS,                                 0,                                 0,                                 255,                                 255,                                 hwndParent,                                 (HMENU) 0,                                 hInst,                                 NULL);         if (hWndListView == NULL)         return NULL; }

But this gives errors:

d:\coding\msvs .net 2003\deney\deney.cpp(48): warning C4715: 'CreateListView' : not all control paths return a value
Deney error LNK2019: unresolved external symbol __imp__InitCommonControlsEx@4 referenced in function "struct HWND__ * __cdecl CreateListView(struct HWND__ *)" (?CreateListView@@YAPAUHWND__@@PAU1@@Z)
Deney fatal error LNK1120: 1 unresolved externals
yadango
yadango
did u remember to link comctl32.lib to your project? one usually gets linker errors when one forgets to link the common control library to the project.
by
by
I didn't link somethink specially. Just started msvc++ 2003 started a new project added #include .

How can i link it?
ApochPiQ
ApochPiQ
Right click your project in the Solution Explorer and choose Properties. In the Configuration dropdown, select All Configurations. Then select the Linker entry in the list on the left; choose the Input section. In the Additional Dependencies box, add comctl32.lib to the end (if anything is already in there). That should solve your problem.
yadango
yadango
from main menu, Project->Properties
click on tree control item "Configuration Properties" to expand it
for Configuration:, select All Configurations
click on tree control item "Linker" to expand it
click on tree control item "Command Line"
in Additional options: edit box, type in comctl32.lib
press apply
press OK
rebuild.
by
by
Thanks, linking solved my problem :)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.