flat assembler
Message board for the users of flat assembler.

Index > Windows > error in creating a dialog box from dialog box

Author
Thread Post new topic Reply to topic
mns



Joined: 20 Dec 2007
Posts: 121
Location: Piliyandala,Sri lanka
mns
Can someone please help me how to correct folloiwig error!!!!! Confused Question
when run the application not opening DLG3
(code is attached with this as zip file)


Description:
Download
Filename: tst.zip
Filesize: 67.72 KB
Downloaded: 30 Time(s)



Last edited by mns on 12 Dec 2011, 11:19; edited 1 time in total
Post 12 Dec 2011, 10:55
View user's profile Send private message Send e-mail Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
1 MB ? lol,
Post 12 Dec 2011, 11:07
View user's profile Send private message Reply with quote
mns



Joined: 20 Dec 2007
Posts: 121
Location: Piliyandala,Sri lanka
mns
typedef why? what is the wrong.I can't understand
Post 12 Dec 2011, 11:18
View user's profile Send private message Send e-mail Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
Well, you have:
1. Some problems with not pop pushed registers in the dialog procedures. You end with "ret" while you must "jmp .finish".
2. Your IDs for the buttons are the same - I mean IDB_BITMAPBTN*
3. Also, why you use "CS" in CreateWindowEx as a lpParam argument ??? "0" is enough and safe.
4. Using 1meg of bitmaps as a button pictures, IMHO is not good for assembly application. (It is not good for HLL app as well).
Post 12 Dec 2011, 11:39
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
mns



Joined: 20 Dec 2007
Posts: 121
Location: Piliyandala,Sri lanka
mns
Thanx JohnFound, I don't have much knowladge in programming.(may be because I am learning it by my self)but can understand 1-3.
But why in assembly language we cannot use lot of bitmaps? and if we want to develop a application which need lot of resources(may be bitmaps) what will we do?
(i'v attached the corrected code with this)


Description:
Download
Filename: tst.zip
Filesize: 67.85 KB
Downloaded: 32 Time(s)

Post 12 Dec 2011, 14:20
View user's profile Send private message Send e-mail Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
mns, of course you can use bitmaps of whatever size you want.
It is, how to say it - "matter of style". Smile
The assembly applications are known as optimal, small and fast.
As an illustration your image pp1.bmp is 24bit bitmap. The size of this image is 220kbytes. There are only 2 colors in the image - if you save it in 2 color bitmap - the file will be only 10kbytes in size.
If you use some compressed format, the size becomes even smaller:
In PNG - 472bytes!
Another level of approach is to draw the buttons on the fly - your buttons are very simple and you simply don't need bitmaps for such simple images.
Post 12 Dec 2011, 14:43
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
mns



Joined: 20 Dec 2007
Posts: 121
Location: Piliyandala,Sri lanka
mns
Hey now I understand what you have said.
Thank you very much JohnFound.I really appriciate your thought.
Thanx again Bro!
Post 12 Dec 2011, 15:45
View user's profile Send private message Send e-mail Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1419
Location: Toronto, Canada
AsmGuru62
Images, like ICO and BMP can be loaded from files by LoadImage API.
This way they do not take room in EXE file and they can be loaded when needed minimizing the application startup time.
Post 12 Dec 2011, 15:51
View user's profile Send private message Send e-mail Reply with quote
mns



Joined: 20 Dec 2007
Posts: 121
Location: Piliyandala,Sri lanka
mns
Thanx! AsmGuru62
Post 12 Dec 2011, 17:17
View user's profile Send private message Send e-mail Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.