flat assembler
Message board for the users of flat assembler.

Index > Windows > Resourse in Iczelion tut

Author
Thread Post new topic Reply to topic
DMD



Joined: 05 Jun 2006
Posts: 24
DMD
Hi to All!

I have tried to repeat Iczelion tut 10-1, 10-2 in FASM.. Works.
But not so conveniently...
There is a question:
As it is possible to describe in FASM resources elements of dialogue + icon.
Instead of to use a file of the description from MASM and to translate it via bres.bat in '*.res' & <section '.rsrc' resource from '*.res' data readable>...

If it is possible, a small example of resource..

Best Regrds!
Post 31 Jul 2006, 07:28
View user's profile Send private message Reply with quote
UCM



Joined: 25 Feb 2005
Posts: 285
Location: Canada
UCM
Look at vbVeryBeginner's translation of Iczelion's tutorials to FASM, available at http://sulaiman.netadvant.com/ .
Post 31 Jul 2006, 13:12
View user's profile Send private message Reply with quote
DMD



Joined: 05 Jun 2006
Posts: 24
DMD
UCM wrote:
Look at vbVeryBeginner's translation of Iczelion's tutorials to FASM, available at http://sulaiman.netadvant.com/ .


Thanks, certainly..
There will be a minute - try №10 - it is very instructive! Cool

Who can will prompt as correctly to work with contorls and menu in FASM?
Post 01 Aug 2006, 08:25
View user's profile Send private message Reply with quote
farrier



Joined: 26 Aug 2004
Posts: 274
Location: North Central Mississippi
farrier
DMD,

Attached is some code from a program I am translating into FASM, most of the button related code is removed in order to show the controls themselves. The dialog uses RadioButtons, CheckBoxes, ComboBoxes, Buttons, StatusBar, VersionInfo, Manifest, and a DateTimeControl. Also an icon is used for the program icon itself and as a static control/display.

vbVeryBeginner's work is an excellent place to start!!

hth,

farrier


Description:
Download
Filename: BareDlg.zip
Filesize: 7.79 KB
Downloaded: 175 Time(s)


_________________
Some Assembly Required
It's a good day to code!
U.S.Constitution; Bill of Rights; Amendment 1:
... the right of the people peaceably to assemble, ...
The code is dark, and full of errors!
Post 01 Aug 2006, 09:48
View user's profile Send private message Reply with quote
DMD



Joined: 05 Jun 2006
Posts: 24
DMD
farrier wrote:
DMD,

Attached is some code from a program I am translating into FASM, most of the button related code is removed in order to show the controls themselves. The dialog uses RadioButtons, CheckBoxes, ComboBoxes, Buttons, StatusBar, VersionInfo, Manifest, and a DateTimeControl. Also an icon is used for the program icon itself and as a static control/display.

vbVeryBeginner's work is an excellent place to start!!

hth,

farrier


Ok, may be.. may be...

you can see the result in attachment..

If I ask a help - it's mean all other way was checked...

I'll try your code. Thanks!
Best regards!


Description:
Filesize: 24.85 KB
Viewed: 4189 Time(s)

Untitled-1.jpg


Post 01 Aug 2006, 15:31
View user's profile Send private message Reply with quote
farrier



Joined: 26 Aug 2004
Posts: 274
Location: North Central Mississippi
farrier
DMD,

Look at Tutorial 10 in the vbVeryBeginner translation. It is written as a Dialog as Main example--just like Iczelions' 10-2--and should be what you are looking for!

hth,

farrier

_________________
Some Assembly Required
It's a good day to code!
U.S.Constitution; Bill of Rights; Amendment 1:
... the right of the people peaceably to assemble, ...
The code is dark, and full of errors!
Post 03 Aug 2006, 03:49
View user's profile Send private message Reply with quote
DMD



Joined: 05 Jun 2006
Posts: 24
DMD
farrier wrote:
DMD,
Look at Tutorial 10 in the vbVeryBeginner translation. It is written as a Dialog as Main example--just like Iczelions' 10-2--and should be what you are looking for!
hth,
farrier

farrier,

yes, you are right.. almost

at first, code vbVeryBeginner not works correctly.

second, in the original this tutorial and in the vbVeryBeginner translation resource define via *.RES file.
It's not fine.

I try to find how I can define resources as usual:

section '.rsrc' resource data readable
directory RT_DIALOG, ialogs, RT_ICON, cons, R_GROUP_ICON, roup_icons
and ect.

You can see youself in the RESOURCE.INC:
macro dialog label,title,x,y,cx,cy,style,exstyle,menu,fontname,fontsize

it's mean that we can define ALL this options...

but... HOW Question Question Question

ps. between us..
in attachment source and exe by Sulaiman aka vbVeryBeginner.
spent 1 min for me and try this
Can you repeat "vbVeryBeginner's work is an excellent place to start!!" one more time?


Description:
Download
Filename: sulaiman_tut_10-2.zip
Filesize: 2.44 KB
Downloaded: 156 Time(s)

Post 03 Aug 2006, 10:43
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1605
Location: Ukraine
shoorick
this is because these tutorials were written under 9x intentionally.
place xor eax,eax at the end of window proc:
Code:
wmBYE:
                    pop  edi esi ebx
                    xor eax,eax
                    ret ; urn    

and it will work ok under 2k/xp Wink
Post 03 Aug 2006, 11:55
View user's profile Send private message Visit poster's website Reply with quote
DMD



Joined: 05 Jun 2006
Posts: 24
DMD
I see
ok, it's help partly... - menu is absent it's all the same.

Main question was about parameters macro "dialog" (see upper)

Who can help?
Post 03 Aug 2006, 13:17
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1605
Location: Ukraine
shoorick
if you wish no suffer - use rc compiler. what a reason to not use it? there are a lot of free tools except from ms: borland free commandline tools have it, watcom package, goasm package, pelle's c package, etc. i have no anything against macros, but i just have no time to calculate pixels etc...
Post 03 Aug 2006, 14:03
View user's profile Send private message Visit poster's website Reply with quote
farrier



Joined: 26 Aug 2004
Posts: 274
Location: North Central Mississippi
farrier
DMD,

After changing the return at the end of the wmBYE: segment to:

Code:
                    xor  eax, eax
                    ret
    


The menu still did not show up as you have stated! I used Resource Hacker--http://www.angusj.com/resourcehacker/--to view the resources of the MASM32 assembled version and the version created by FASMW 1.67.7; they were different in one substantial way

Resoiurce Hacker report for MASM32 version:
Menu:
Code:
3003 MENU
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
{
POPUP "Test Controls"
{
        MENUITEM "Get Text",  32000
        MENUITEM "Clear Text",  32001
        MENUITEM SEPARATOR
        MENUITEM "E&xit",  32003
}
}
    


Dialog:
Code:
MYDIALOG DIALOG 10, 10, 205, 60
STYLE DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Our Second Dialog Box"
MENU 3003
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
{
   CONTROL "", 3000, EDIT, ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 15, 17, 111, 13 
   CONTROL "Say Hello", 3001, BUTTON, BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 141, 10, 52, 13 
   CONTROL "E&xit", 3002, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 141, 26, 52, 13 
}
    


Resoiurce Hacker report for FASM version:
Menu:
Code:
30 MENUEX
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
{
POPUP "Test Controls", 0, MFT_STRING, MFS_ENABLED, 0
{
        MENUITEM "Get Text", 32000, MFT_STRING, MFS_ENABLED
        MENUITEM "Clear Text", 32001, MFT_STRING, MFS_ENABLED
        MENUITEM "", 0, MFT_SEPARATOR, MFS_ENABLED
        MENUITEM "E&xit", 32002, MFT_STRING, MFS_ENABLED
}
}
    


Dialog:
Code:
31 DIALOG 10, 10, 205, 60
STYLE DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_NOPARENTNOTIFY | WS_EX_TOPMOST | WS_EX_ACCEPTFILES
CAPTION "Our First Dialog Box"
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
FONT 8, "MS Sans Serif"
{
   CONTROL "", 3000, EDIT, ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 15, 17, 111, 13 
   CONTROL "Say Hello", 3001, BUTTON, BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 141, 10, 52, 13 
   CONTROL "E&xit", 3002, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 141, 26, 52, 13 
}
    


FASM uses MENUEX vs. MASM using MENU, but the significant difference is the absence of a reference to the Menu resource within the Dialog resource. In the MASM dialog resource, the is a line:

Code:
MENU 3003    


and there is no reference to the Menu resource in the FASM dialog resource. Using Resource Hackers ability to modify an EXE files resource, I added the line:

Code:
MENU 30    


and saved the modification. With this modification, the FASM EXE worked as expected.

I'm going to look at the FASM resource macros, but I get easily confused trying to figure out what these macros do! They work great, I just don't understand them!

farrier

_________________
Some Assembly Required
It's a good day to code!
U.S.Constitution; Bill of Rights; Amendment 1:
... the right of the people peaceably to assemble, ...
The code is dark, and full of errors!
Post 04 Aug 2006, 05:17
View user's profile Send private message Reply with quote
farrier



Joined: 26 Aug 2004
Posts: 274
Location: North Central Mississippi
farrier
DMD,

Easily fixed! You--and I--looked at the problem but didn't see it. On the line describing the Dialog resource:

Code:
     dialog dlgMain,'Our First Dialog Box',10,10,205,60,\
          DS_CENTER + WS_CAPTION + WS_MINIMIZEBOX + WS_SYSMENU + WS_VISIBLE + WS_OVERLAPPED + DS_MODALFRAME + DS_3DLOOK,30
    

the last parameter here is actually where the exstyle should be:

Code:
macro dialog label,title,x,y,cx,cy,style,exstyle,menu,fontname,fontsize
    


To make it work, change the line to:

Code:
     dialog dlgMain,'Our First Dialog Box',10,10,205,60,\
          DS_CENTER + WS_CAPTION + WS_MINIMIZEBOX + WS_SYSMENU + WS_VISIBLE + WS_OVERLAPPED + DS_MODALFRAME + DS_3DLOOK,0,30
    


And I still say the vbVeryBeginner translations are a great place to start. Look how much I learned!! They're just not perfect!

farrier

_________________
Some Assembly Required
It's a good day to code!
U.S.Constitution; Bill of Rights; Amendment 1:
... the right of the people peaceably to assemble, ...
The code is dark, and full of errors!
Post 04 Aug 2006, 17:02
View user's profile Send private message Reply with quote
DMD



Joined: 05 Jun 2006
Posts: 24
DMD
farrier wrote:
And I still say the vbVeryBeginner translations are a great place to start. Look how much I learned!! They're just not perfect!

farrier

farrier,

"And I still say the vbVeryBeginner translations are a great place to start. Look how much I learned!! They're just not perfect!"

I see. Congratulation!

As for me,
If "a great place to start", it`s cannot be "They're just not perfect!"
If "They're just not perfect!" cannot be "a great place to start"

At us it names to confuse sour with red! Sorry...

May be You know answer on this very old question?

Whether the God can create a stone which cannot lift himself?
If - can - he allmighty but it is not omnipotent
If - is not - he not allmighty..

Course, I know right answer! And You?

If seriously, this is http://www.winasm.net/forum/index.php?showtopic=943 has name "Nice job"...
Post 11 Aug 2006, 11:26
View user's profile Send private message Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6029
Location: Poland
MHajduk
DMD wrote:
Whether the God can create a stone which cannot lift himself?

If I remember correctly, this paradox was invented by Polish mathematician Stefan Banach when he was a schoolboy. Banach asked this question to the priest and totally confused him. Laughing

Regards,
M.H.
Post 11 Aug 2006, 12:04
View user's profile Send private message Visit poster's website Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1605
Location: Ukraine
shoorick
bad tutorials can make better experience: "if everybody says excellent and easy (even if they were not try it Wink ) - why i cann't??? i shall!!!"
Post 11 Aug 2006, 12:28
View user's profile Send private message Visit poster's website Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 885
Location: \\world\asia\malaysia
vbVeryBeginner
lol Very Happy Very Happy Very Happy
yo yo dmd, farrier :p

sorry for all the problem u got while learning, the source couldn't be copy & paste and assemble directly coz there were changes from the fasm i used last time compare to current fasm. regarding the .res file, i just use that to learn how to use the .res file Smile and btw, ( i was a newbie back then Laughing Laughing ) i did those tutorial as my exercise to understand asm and windows programming.

btw,
regarding, Whether the God can create a stone which cannot lift himself?
it is like if the power of God is infinity eg, - infinity to 0 to + infinity.
then you ask God to create a number (biggest number) which the number cannot grow anymore. the problem is, the meaning of all the words/number/sequence we used are reside on the power of God, they are all created by God, (God can change them if God so wishes) and when they were created and during the creation, they already proved themselves they are lower than the power of creation and their existence relied on the power of God.

the logic is, how could a "created" thing be so powerful to stop the power that created that thing? and no matter how powerful the created thing could go, it couldn't change the fact/history that its existence was due to power that created it.

so the statement, "Whether the God can create a stone which cannot lift himself?" is actually invalid and contradicted in itself. imho.
Post 11 Aug 2006, 13:20
View user's profile Send private message Visit poster's website Reply with quote
DMD



Joined: 05 Jun 2006
Posts: 24
DMD
MHajduk wrote:

If I remember correctly, this paradox was invented by Polish mathematician Stefan Banach when he was a schoolboy. Banach asked this question to the priest and totally confused him. Laughing
Regards,
M.H.

MHajduk,
I can imagine this talk!
Of course, priest not was the professor of theology. But we know answer...

vbVeryBeginner wrote:

so the statement, "Whether the God can create a stone which cannot lift himself?" is actually invalid and contradicted in itself. imho.

vbVeryBeginner,
You are not quite right because using method by syllogism: invalid as actually invalid.

Ok, the answer is: Got as extra-essence do not permit self-contradiction. We can't to use ordinary logic for him.
If it is necessary to create - will create
if to lift - will lift.

So, let's stop flame(flood). And continue coding!

vbVeryBeginner,
I understand your thought about your translated tutorials.
I think all tutorials originally was make as "copy & paste". It's logically. imho.
Else what for needs posting examples include heading and source of all section: .data, .idata, .rsrc?

On my mind, it's very deeper and difficult problem: How teach?

Everyone answers himself...
shoorick wrote:
bad tutorials can make better experience: "if everybody says excellent and easy (even if they were not try it Wink ) - why i cann't??? i shall!!!"

Mr shoorick only has confirmed my thoughts!

Have a nice day and good code!
Smile
Post 14 Aug 2006, 10:23
View user's profile Send private message Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 885
Location: \\world\asia\malaysia
vbVeryBeginner
Post 14 Aug 2006, 16:24
View user's profile Send private message Visit poster's website Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1605
Location: Ukraine
shoorick
there is need to separate examples from tutorials. own projects, written once ago to understand some and then shared can not be tutorials, of course. tutorials have to be written by man, experienced both in subject, and in "teaching technology": source has to be clean, has no any not understandable, teacher has to guess possible mistakes, thus, not only comment "here we do this", but also note what can be if we omit this, or why we have to do this. tutorials always supposed some level of student, etc... etc... it's not easy to write good tutorial in real. From other side we have what we have, and thanks that we have anything to start at all Wink
regards!
Post 14 Aug 2006, 20:43
View user's profile Send private message Visit poster's website 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-2019, Tomasz Grysztar.

Powered by rwasa.