News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Example for Luis.

Started by hutch--, June 07, 2017, 01:05:47 PM

Previous topic - Next topic

hutch--

Luis,

This is how to use the three functions you asked about.

One thing, I do have a life and things to do and responding to individual help by PM takes up too much of my time. Post any questions here in the open forum.

With the following code, copy it into QE, save it as whatever file name you want with an ".asm" extension and run "Console Assembler And Link" and it will build for you. The output will look like this.

----------
GetAppPath
----------
K:\asm32\paths\
------------
NameFromPath
------------
paths.exe
-----------
GetPathOnly
-----------
K:\asm32\paths\
Press any key to continue ...


The code.


; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

    include \masm32\include\masm32rt.inc

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

comment * -----------------------------------------------------
                        Build this  template with
                       "CONSOLE ASSEMBLE AND LINK"
        ----------------------------------------------------- *

    .code

start:
   
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

    call main
    inkey                                   ; wait until you press a key so you can see the results
    exit

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

main proc

    LOCAL ppath :DWORD                      ; allocate a pointer for the text buffer
    LOCAL pbuff[260]:BYTE                   ; allocate a 260 byte buffer

    lea eax, pbuff                          ; load the buffer address
    mov ppath, eax                          ; write address to pointer

    print "----------",13,10
    print "GetAppPath",13,10
    print "----------",13,10
    invoke GetAppPath,ppath                 ; get the application's full path
    print ppath,13,10

    invoke GetModuleFileName,0,ppath,260    ; load the full path and file name

    print "------------",13,10
    print "NameFromPath",13,10
    print "------------",13,10
    invoke NameFromPath,ppath,ppath         ; extract only the name from a full path and file name
    print ppath,13,10

    invoke GetModuleFileName,0,ppath,260    ; load the full path and file name

    print "-----------",13,10
    print "GetPathOnly",13,10
    print "-----------",13,10
    invoke GetPathOnly,ppath,ppath          ; extract only the full path
    print ppath,13,10

    ret

main endp

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

end start

aw27

Forgive my ignorance but I don't remember any Luis around here. Is it an idiomatic expression? :badgrin:

anunitu

From what Hutch posted,it seems his answer was in response to a PM,that I also received. Might be he PMed MANY members.

felipe

Quote from: aw27 on June 07, 2017, 05:36:23 PM
Forgive my ignorance but I don't remember any Luis around here. Is it an idiomatic expression? :badgrin:

Maybe is a ghost!... :dazzled:............................ :lol:

Mikl__

#4
It is OZ idiom "Everybody and brother Luis"  :biggrin:
Quotehttp://mp3party.net/music/180432

Dear, love is a burning fire
Stay, cause then the flames grow higher
Babe, don't let him steel your heart
It's easy - easy
Girl, this game can't last forever
Why we cannot live together
Try - don't let him take your love from me
You're no good, can't you see Brother Louie, Louie, Louie
I'm in love - set you free
Oh, she's only looking to me
Only love breaks her heart Brother Louie, Louie, Louie
Only love's paradise
Oh - she's only looking to me
Brother Louie, Louie, Louie
Oh, she's only looking to me
Oh, let it Louie
She is undercover
Brother Louie, Louie, Louie
Oh, doing what he's doing
So,...

hutch--

anunitu got it right, I help folks out where I can but someone you don't know asking for private help by private message is just adding to the workload to even respond. I asked for the question to be posted in the open forum so more people can see it, that works for everyone and reduces the work load. I have been fascinated for a long time that so many people only see you as a function accessible on the internet and while I confess to being an "industrial robot" with code production, I do all of those normal things like eating, sleeping and a whole host of other things so I am nominally a human being.  :biggrin:

aw27


alejandroalas7536

Thanks my friend hutch--, your help was very useful to my, you are very kind, thanks a lot for your amability.
I am Luis

felipe

Luis:

I thought you were a ghost because you were whispering to all... :icon_mrgreen:

Just kidding, welcome to the forum!  :t