The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Infro_X on April 01, 2005, 06:11:41 AM

Title: CreateWindowEx Failing with invalid class
Post by: Infro_X on April 01, 2005, 06:11:41 AM

.data
ListView DB "SysListView32",0
.code
invoke CreateWindowEx,NULL,addr ListView,NULL,LVS_LIST | LVS_SINGLESEL | LVS_SHOWSELALWAYS |  \
LVS_SORTASCENDING | LVS_AUTOARRANGE | WS_BORDER | WS_TABSTOP | WS_CHILD | WS_VISIBLE,0,0,0,0,[hDlg],NULL,[hInst],NULL

fails with the error code ERROR_CANNOT_FIND_WND_CLASS
it will succeeded if i change the class to EDIT or BUTTON, anyone? (i've ran into this problem before, but have to clue as to how i fixed it last time, and it doesn't matter where i call the code from it seems to always fail
Title: Re: CreateWindowEx Failing with invalid class
Post by: hutch-- on April 01, 2005, 06:44:16 AM
You do have to load the common control library to use the common controls.


    LOCAL icce:INITCOMMONCONTROLSEX
   
    mov icce.dwSize, SIZEOF INITCOMMONCONTROLSEX
    mov icce.dwICC,  ICC_LISTVIEW_CLASSES
    invoke InitCommonControlsEx,ADDR icce


See if this works.
Title: Re: CreateWindowEx Failing with invalid class
Post by: Infro_X on April 01, 2005, 07:17:26 AM
note to self,
golink kernel32.dll user32.dll advapi32.dll COMCTL32.DLL %1.res %1.rc
(was wondering why it stopped working in RadASM after i took out GetOpenFile dialog.)
;)
Thanks hutch