From: JGCASEY on
Hi all,

Although I posted this to the FASM group without
a reply as yet I thought I might cast my net
wider as this has become a real hump in my road
to understanding how to program windows APIs
with assembler.

My background: NASM using the NASMIDE IDE in DOS.

I am trying to get back to some assembler programming
after a six year absence but this time with Windows.

I am now up to Iczelion's Tutorial 8, Menu.

I am using Iczelion's tutorial along with Sulaiman
Chang's FASM versions of the examples.

What 'language' does a resource script use?

It appears different with MASM and FASM.

Is it the Assembler or the OS that reads this script?

I assume the LoadMenu API is how the menu resource
script is referenced to the program.

invoke LoadMenu, [wHInstance], 30 ; FASM

invoke LoadMenu, hInst, OFFSET MenuName ; MASM

Now in MASM, 'MenuName' is an address label to a
byte array, "FirstMenu",0

In the FASM version it is what?

I have found the 30 in the resource section:

resource appMenu, 30, LANG_ENGLISH, menuMain

and,

menuitem 'MenuBar C (without item)', 30, MFR_END

which I take is an ID that is returned in the
wmCOMMAND's wParam when the item with that ID
is clicked.

Is there any easy way to understand all this?

Regards,

John Casey

email: jgkjcasey at yahoo.com.au

From: randyhyde@earthlink.net on

JGCASEY wrote:
> Hi all,
>
> Although I posted this to the FASM group without
> a reply as yet I thought I might cast my net
> wider as this has become a real hump in my road
> to understanding how to program windows APIs
> with assembler.
>
>
> I am now up to Iczelion's Tutorial 8, Menu.
>
> I am using Iczelion's tutorial along with Sulaiman
> Chang's FASM versions of the examples.
>
> What 'language' does a resource script use?

The "resource" language.
This is defined by Microsoft and others (each with their own variants).
ICZ probably uses the Microsoft variant.

>
> It appears different with MASM and FASM.

Hmmm....

>
> Is it the Assembler or the OS that reads this script?

Neither. It is the RC.EXE (or similar) program that compiles the
resource source file into an object file.

>
> I assume the LoadMenu API is how the menu resource
> script is referenced to the program.

Yes, but the object file produced by the resource compiler is linked
with your executable like any other.


>
> Is there any easy way to understand all this?

MSDN. Search for "resource compiler" or "resource language".
Cheers,
Randy Hyde

From: JGCASEY on

randyhyde(a)earthlink.net wrote:
> JGCASEY wrote:

....

> > Is there any easy way to understand all this?
>
> MSDN. Search for "resource compiler" or "resource language".

Found it thanks Randy. There is no easy way of doing this
is there? With all the paper work, manuals to digest and
forms to make out it feels more like learning to be a lawyer
than doing any actual programming :)

Windows is a bureaucrats paradise on earth.


Cheers,
John Casey

From: Betov on
"JGCASEY" <spamtrap(a)crayne.org> ?crivait news:1127087879.621933.74500
@g43g2000cwa.googlegroups.com:

> Is there any easy way to understand all this?


Yes. See what a memory Resources Template is,
with RosAsm:

A Resource is nothing but a chunk of Data,
informing the OS about the wanted Dialog
Structure (and various Components). This
"chunk of Data" may, as well, be stored in
"normal Data" as in the Resources Section.

The main differences you will see in between
FASM and NASM Templates will probably be the
fact that the MASM users (who are mainly HLL
Programmers) most often refer to the Dialogs
by "Named IDs", and that the FASM users (who
are, mainly, Assembly Programmers), do it,
like in RosAsm, by "Numbered ID". Maybe that
could be the case with your Menu reference
example.


Betov.

< http://rosasm.org >




From: sevagK on
FASM writes resources directly into the resource section, you can use
some macros to make it easier (I haven't looked in a while, but I
suspect the tutorials use the macros). You also have the option of
including a pre-compiled resource binary, there was a directive for
doing so. Of course, you can also compile to PE COFF and use a
separate resource compiler and linker (PORC and POLINK are great for
this).

-sevagK.
www.geocities.com/kahlinor

 |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8
Prev: qsort
Next: HLA wont compile!!