Hey folks,

i got one little problem, may be you guys can help
have a look at this code:


.386
.model flat,stdcall
option casemap:none

include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\gdi32.inc
include \masm32\include\masm32.inc
include \masm32\include\shell32.inc
include \masm32\include\comctl32.inc
include \masm32\include\comdlg32.inc
include \masm32\include\advapi32.inc
include \masm32\include\crypt32.inc

includelib \masm32\lib\shell32.lib
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\gdi32.lib
includelib \masm32\lib\masm32.lib
includelib \masm32\lib\comctl32.lib
includelib \masm32\lib\comdlg32.lib
includelib \masm32\lib\advapi32.lib
includelib \masm32\lib\crypt32.lib

DlgProc PROTO :DWORD,:DWORD,:DWORD,:DWORD

.data

DlgName db "Modifier",0
MenuName db "ModiMenu",0
StatusText db "by |TyPhOoN|",0
Text db "The text",0
Openfiles OFSTRUCT<>
FileName db "\masm32\bin\ml.exe",0
CommandLine db " /c /coff /Cp \masm32\bin\button.asm",0
FileName2 db "\masm32\bin\link.exe",0
CommandLine2 db " /SUBSYSTEM:WINDOWS /LIBPATH:c:\masm32\lib \masm32\bin\button.obj",0
processInfo PROCESS_INFORMATION <>

.data?
hInstance HINSTANCE ?
hWritten dd ?
hInput dd ?
hOutput dd ?

.const
IDC_APPLY equ 3001

IDM_EXIT equ 4001
IDM_ABOUT equ 4002

IDS_STATUS equ 5001


.code
start:

invoke GetModuleHandle, NULL
mov hInstance, eax
invoke DialogBoxParam, hInstance, ADDR DlgName,NULL, addr DlgProc, NULL
invoke ExitProcess,eax

DlgProc proc hWin :DWORD, uMsg :DWORD, wParam :DWORD, lParam :DWORD
LOCAL startInfo:STARTUPINFO
.IF uMsg==WM_COMMAND
mov eax,wParam
mov edx,wParam
shr edx,16
.IF dx==BN_CLICKED

.IF ax==IDM_EXIT
invoke SendMessage,hWin,WM_CLOSE,0,0
.ELSEIF ax==IDC_APPLY
invoke AllocConsole
invoke GetStdHandle, STD_INPUT_HANDLE
mov hInput, eax
invoke GetStdHandle, STD_OUTPUT_HANDLE
mov hOutput, eax
invoke WriteConsole,hOutput,addr Text,8,addr hWritten,NULL
invoke GetStartupInfo,ADDR startInfo
invoke CreateProcess,addr FileName,addr CommandLine,NULL,NULL,FALSE,\
NORMAL_PRIORITY_CLASS,\
NULL,NULL,ADDR startInfo,ADDR processInfo
invoke CloseHandle,processInfo.hThread
invoke CreateProcess,addr FileName2,addr CommandLine2,NULL,NULL,FALSE,\
NORMAL_PRIORITY_CLASS,\
NULL,NULL,ADDR startInfo,ADDR processInfo
invoke CloseHandle,processInfo.hThread



.ENDIF

.ENDIF
.ELSEIF uMsg==WM_INITDIALOG

.ELSEIF uMsg==WM_CLOSE
invoke EndDialog,hWin,NULL

.ENDIF
ret
DlgProc endp
end start

Well, everything actually works fine, except if i have the obj file in the bin folder of masm32.
How come and how can i fix that ?
Posted on 2001-10-22 13:01:51 by Olli
If this is what I think it is, please use this batch file process instead...

1. Make a file call "build.bat" (or whatever you want as long as it is .bat)
2. Place this file in the directory with your assembly code file.
3. Edit this file and put this in it...

@ECHO OFF
CLS
C:\masm32\bin\ml /c /coff /Cp filename.asm |more
C:\masm32\bin\rc filename.rc
C:\masm32\bin\link /SUBSYSTEM:WINDOWS /LIBPATH:c:\masm32\lib filename.obj ".\filename.res"

4. Replace the "filename" name in the batch file with the name of the assembly file you are going to use.
5. If you are not going to use the resource script compiler, then put "REM " on line 4 so it looks like this...
REM C:\masm32\bin\rc filename.rc
then erase the "".\filename.res"" from line 5/6.
6. The "|more" command will allow you to see all of your code errors instead of the command prompt spewing out all of it for you to miss.
Posted on 2001-10-22 13:40:06 by SpooK