Author Topic: List View?  (Read 3649 times)


  • Guest
List View?
« on: September 06, 2012, 09:33:30 AM »

Im begginer in masm programming, I already programmed in Delphi and Visual Basic,
Please answer easy, becouse Im very noob...
I trying to do a program to connect in a data bank in access, becouse assembler is very fast and smaller, and don't need to to copy to destination computer dll's files
I following some tutorials and examples,
I trying to do a listview, at this time, I just want to put the listview in corret positon, after I will work with data of data bank
but my program not show the list view, I tryied one hundred of manners, but not work, the program's run, but the list view doesn't show.

#define LVS_REPORT              0x0001
#define LVS_SINGLESEL           0x0004
ListView_ID      equ 1005
ListViewClassName db "SysListView32", 0
.data ?
hwnd_ListView   HWND      ?
invoke InitCommonControls
invoke CreateWindowEx, NULL, ADDR ListViewClassName, NULL, \
             WS_BORDER OR WS_TABSTOP, \
              0, 0, 700, 500, hWnd, ListView_ID, hInstance, NULL
mov hwnd_ListView, eax

Please, why the program not show the list view?


  • Administrator
  • Member
  • ******
  • Posts: 7447
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: List View?
« Reply #1 on: September 06, 2012, 10:00:15 AM »
Hi drprogrammer,

Welcome on board. I moved your topic to the Campus so that your posting would be seen by more people.

[typo]  :biggrin:
« Last Edit: September 06, 2012, 02:36:19 PM by hutch-- »
hutch at movsd dot com    :biggrin:  :skrewy:


  • Member
  • *****
  • Posts: 1473
  • The base type of a type is the type itself
    • SmplMath macros
Re: List View?
« Reply #2 on: September 06, 2012, 10:35:59 AM »
based on your code fragments, I assume that the problem is the missing style WS_CHILD.

BTW: an EQU (= similar to c/c++'s #define) exist only while assembling - there is no need to place this directive in a segment (.const in your case)
MREAL macros - when you need floating point arithmetic while assembling!


  • Guest
Re: List View?
« Reply #3 on: September 06, 2012, 11:00:42 AM »
Yes, you are right, was missing WS_CHILD, now showing the listview!!!!!
some tutorials and examples that i was used show .const with EQU
if I not use this EQU what should use?


  • Member
  • *****
  • Posts: 8827
  • Still using Abacus 2.0
    • DednDave
Re: List View?
« Reply #4 on: September 06, 2012, 06:34:00 PM »
i usually put most of my EQUates before i open any section

placing EQU inside a section doesn't hurt anything
but, it does not generate any code or data
if the .CONST section is otherwise empty, likely it does not get created   :P

.CONST doesn't make as much sense in assembler as it does in compiled code
i usually put constant data in the .DATA section
then, it is my responsibilty to ensure that it does not get overwritten
creating a .CONST section otherwise serves to increase EXE size


  • Member
  • ***
  • Posts: 377
  • Procrastinor Extraordinaire
Re: List View?
« Reply #5 on: September 07, 2012, 12:29:03 AM »
Placing EQUates in a const section does nothing as far as the section is concerned - if it's otherwise empty, it may as well not be there. EQU itself doesn't produce any data, it just provides a more readable name for values you might use.

Placing initialised data in a const section will reduce the size of your exe, compared with placing them in their own data section. A read-only data section (what .const equates to) is already added to your exe for storing the import strings (dll and function names), so your own const data is just added into this section. If you put your data in a writable data section (.data) then a whole new section is added to the exe just for this (and the other read-only section is also still there.)

So, unless you specifically intend to modify your initialised data, it's preferable to place it in a const section. It's smaller overall, and your data is protected against writing by the OS (an exception is thrown if attempted.)