News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Question about PROTO format in DLL

Started by Rainstorm, September 17, 2006, 09:24:41 AM

Previous topic - Next topic

Rainstorm

Hi.

In all the formats for Prototypes I've seen it like this
PROTO :DWORD,:DWORD,:DWORD

I was going through the dlltute.asm file & there the prototypes are like this

MessageBoxSTD PROTO STDCALL :DWORD,:DWORD,:DWORD,:DWORD,:DWORD

also the corresponding procedure line

MessageBoxSTD proc STDCALL hParent:DWORD,lpMsg:DWORD,
              lpTitle:DWORD,dlgStyle:DWORD,iconID:DWORD


both have the extra calltype name STDCALL in their format, after the word Proto.

could someone tell me something about that.

is that to be followed only for dlls ?

also, for proc & protos its okay for the statements to trail into the next line

thanks.

-

hutch--

The prototype format in masm32 assumes that your app has the default prototype set to STDCALL like the following.


      .486                      ; create 32 bit code
      .model flat, stdcall      ; 32 bit memory model
      option casemap :none      ; case sensitive


All you need to change with prototypes is if you use a C calling convention where you write it like this.


MyProc PROTO C :DWORD,:DWORD, etc ....
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

zooba

And the statement can continue onto the next line if the first line ends in a comma or backslash. MASM assumes that there has to be more items following the comma, so it keeps looking, and the backslash is defined as the line-continuation character, which means MASM treats both lines as one. Note that there is a limit on line length (around 255 characters I think) which includes whitespace, so don't continue too much :wink

Cheers,

Zooba :U

sihotaamarpal

hi rainstorm,

   proto c or proto stdcall or proto pascal r the calling conventions

   proto c: reads parameters from right to left and pushed to stack,this is useful when u does,nt know the no. of parameters
               passed to yur procedures

   proto pascal:is oposite to c,left to right where no of parameters list remain constant

   proto stdcall:combines c and pascal

@@:
regards
sihota



 
             

Rainstorm

hutch wrote..
QuoteThe prototype format in masm32 assumes that your app has the default prototype set to STDCALL like the following.
So that's an assumed part of the statement that needs
to be specified only if it is something diff...makes more sense now.

:thumbu for the extra info sihotaamarpal

zooba thanks for the info. - that clears it up for me.
-

Rainstorm

hi.

thought i'd just ask this here instead of starting another thread.

are there some functions documented in the masm32 help files which can be used only by
including masm32rt.inc ?
include \masm32\include\masm32rt.inc

what i mean is can these functions be accessed & used by including some other files or are they
only available through masm32rt.inc

also I see the str$() function in examples but can't find it in the masm help files
i found ustr$ though
is str$ an old function or something ?


ty

-

PBrennick

Rainstorm,
The purpose of masm32rt.inc is to simplify your coding.  At the beginning of each source there are a series of directives, commonly used include files and commonly used libraries.  There is nothing magical about it and it does nothing else.  It is a good idea to use it because it makes life easier for you but it is in no way necessary.

Paul
The GeneSys Project is available from:
The Repository or My crappy website

Rainstorm

I just opened the masm32rt.inc
& it doesn't seem so..it just includes all the files etc like in the  normal structure

(correct me though if i am wrong)

-


Rainstorm

guess we posted togethr..

was having a prob assembling something  & it assembled & ran fine when i replaced the usual structure with masm32rt.inc. was probably a file i hadn't included

thanks for the prompt reply..




PBrennick

The GeneSys Project is available from:
The Repository or My crappy website