News:

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

Nothing

Started by Fernand, September 07, 2007, 07:14:35 PM

Previous topic - Next topic

Fernand

I , I am a newbe and I still nedd your help.
I compiled this code and \i got no error.
I executed this program, I got the cmd.exe and the clearscreen but I can not display the messages ! :(
The StdOut do not work...I used the user32.lib and .inc
What is wrong with this code....

   .data
szCmd       db "cmd.exe",0
message     db  "Je me réserve un peu d'espace pour m'amuser",0
a_la_line   db  13,10,0
essdword    DWORD   0

    .code

debut:
 
    invoke WinExec,addr szCmd,SW_SHOWDEFAULT
    invoke ExitProcess,0

    cls
    xor     eax, eax
    mov     essdword, eax

    mov byte    ptr essdword[0], 00h
    mov byte    ptr essdword[1], 11h
    mov byte    ptr essdword[2], 22h
    mov byte    ptr essdword[3], 33h

    invoke  StdOut, addr message
    invoke  StdOut, addr a_la_line
    invoke  dw2hex, essdword, addr message
    invoke  StdOut, addr a_la_line
    invoke  dwtoa,  essdword, addr message
    invoke  StdOut, addr a_la_line

    invoke ExitProcess,0

end debut

Fernand

Vortex

Did you specify the correct subsystem? If you use the /CONSOLE switch, you don't have to start an extra commandline session with cmd.exe :

link /SUBSYSTEM:CONSOLE objectfile.obj etc...

Fernand

I Vortex
Yes I did.....

Console Link &OBJ File,\MASM32\BIN\Lnkc.bat {b}
&Console Assemble && Link,\MASM32\BIN\Buildc.bat {b}
Console Build &All,\MASM32\BIN\Bldallc.bat {b}

Fernand

Vortex

I think I discovered the problem :

    .code

debut:

    invoke WinExec,addr szCmd,SW_SHOWDEFAULT
    invoke ExitProcess,0 ; This the first ExitProcess. It should be removed.


There are two ExitProcess functions in your code. After the first one, the application will not execute the remaining statements.

Fernand

I Vortex
I remove the first (invoke ExitProcess,0  and all is OK

Thank you very much for your help :U
Fernand