Pages: 1 2 [3]
|
 |
|
Author
|
Topic: Memory dialogs revisited. (Read 23944 times)
|
dedndave
|
mov icce.dwSize, SIZEOF INITCOMMONCONTROLSEX xor eax, eax or eax, ICC_ANIMATE_CLASS or eax, ICC_BAR_CLASSES or eax, ICC_COOL_CLASSES or eax, ICC_DATE_CLASSES or eax, ICC_HOTKEY_CLASS or eax, ICC_INTERNET_CLASSES or eax, ICC_LISTVIEW_CLASSES or eax, ICC_PAGESCROLLER_CLASS or eax, ICC_PROGRESS_CLASS or eax, ICC_TAB_CLASSES or eax, ICC_TREEVIEW_CLASSES or eax, ICC_UPDOWN_CLASS or eax, ICC_USEREX_CLASSES or eax, ICC_WIN95_CLASSES mov icce.dwICC, eax invoke InitCommonControlsEx,ADDR icce yikes ! how about..... ICC_FLAGS = ICC_WIN95_CLASSES ICC_FLAGS = ICC_FLAGS or ICC_ANIMATE_CLASS ICC_FLAGS = ICC_FLAGS or ICC_BAR_CLASSES ICC_FLAGS = ICC_FLAGS or ICC_COOL_CLASSES ICC_FLAGS = ICC_FLAGS or ICC_DATE_CLASSES ICC_FLAGS = ICC_FLAGS or ICC_HOTKEY_CLASS ICC_FLAGS = ICC_FLAGS or ICC_INTERNET_CLASSES ICC_FLAGS = ICC_FLAGS or ICC_LISTVIEW_CLASSES ICC_FLAGS = ICC_FLAGS or ICC_PAGESCROLLER_CLASS ICC_FLAGS = ICC_FLAGS or ICC_PROGRESS_CLASS ICC_FLAGS = ICC_FLAGS or ICC_TAB_CLASSES ICC_FLAGS = ICC_FLAGS or ICC_TREEVIEW_CLASSES ICC_FLAGS = ICC_FLAGS or ICC_UPDOWN_CLASS ICC_FLAGS = ICC_FLAGS or ICC_USEREX_CLASSES
.DATA icc INITCOMMONCONTROLSEX <sizeof INITCOMMONCONTROLSEX,ICC_FLAGS>
.CODE INVOKE InitCommonControlsEx,offset icc total size ~ 18 bytes Hutch - i doubt there is any harm in initializing controls you don't use although, it may use memory unnecessarily the problem i see is that if you don't initialize the ones you do use.... .... it has to be tested on a platform that exhibits the problem 
|
|
|
Logged
|
|
|
|
hutch--
Administrator
Member
    
Posts: 12013
Mnemonic Driven API Grinder
|
Dave,
Apart from the MASM line length limit there is nothing to stop you from orring the whole lot together so that you only had 4 bytes but size is not the problem, I am trying to quantify why initialising all of the controls works on some Windows versions but not others and by versions I mean the language version. I cannot duplicte the problem with any of my US English versions.
I have the OR list for convenience of being able to comment them in and out, not for minimum size even though their memory usage is trivial.
|
|
|
Logged
|
|
|
|
dedndave
|
that's why i listed them seperately, as well - so you can comment them out i see a lot of uninitialied structures - initialized in code if you initialize a dword in code, it usually takes at least 5 bytes  why not just pre-initialize the data - execution time = 0 - and it is smaller (it might make sense if much of the structure need not be initialized)
|
|
|
Logged
|
|
|
|
Antariy
|
Alex, I have no doubt that many read you post, its just that I remembered it.  Thank you, Hutch! 
|
|
|
Logged
|
|
|
|
hutch--
Administrator
Member
    
Posts: 12013
Mnemonic Driven API Grinder
|
Dave,
The assumption that the size matters is one we don't share, this type of stuff most probably would not line up to the next 512 byte section. I am far more interested in getting it to work on multiple language versions.
|
|
|
Logged
|
|
|
|
Antariy
|
Jochen: call InitCommonControlsEx ; this will never be called, but
 this is right, the dll just should be statically linked. On my system InitCommonControls code is just a RET as first instruction of the "function". Very funny. What it is on other systems?
|
|
|
Logged
|
|
|
|
Vortex
Raider of the lost code
Member
    
Gender: 
Posts: 3460
|
Hi Hutch,
Thanks for the new version of the example. It works fine. InitCommonControls solved the problem.
Hi Antariy,
I remembered for your posting, thanks.
|
|
|
Logged
|
|
|
|
Ramon Sala
Easy Code programmer
Member
    
Gender: 
Posts: 425
|
Hi Hutch,
This is my report for catalan and spanish versions of Windows:
Win2K3 Server and Win7 32-64 bit: The dialog works fine without initializing common controls.
WinXp SP3: The dialog just works if common controls are initialized. However, calling InitCommonControls is enough (no need to call InitCommonControlsEx).
Regards.
|
|
|
Logged
|
Greetings from Catalonia
|
|
|
jj2007
|
 this is right, the dll just should be statically linked. On my system InitCommonControls code is just a RET as first instruction of the "function". Very funny. What it is on other systems? Win XP SP2, Italian edition: InitCommonControls is just a retn, and static linking without actually calling it makes the dialog work  InitCommonControls Ex has the same positive effect, but when you call it, there is a bit more than just a retn. It starts with the intelligent opcode mov edi, edi ;-)
|
|
|
Logged
|
|
|
|
dedndave
|
perhaps there is more to it than meets the eye it may be that pulling the function in also pulls in some other code and/or data that is not readily obvious
|
|
|
Logged
|
|
|
|
|
Pages: 1 2 [3]
|
|
|
 |