I am having some problems with the following code. It works but instead of returning a msg I get junk.




;====================================================
; Place ErrBuf address in edi, AppTitle in esi
;====================================================
lproc HandleError

push NULL
push 0 ;Smallest buffer to allocate.
push edi
mov ecx, SUBLANG_DEFAULT
push ecx

call [GetLastError]
push eax

push NULL
push FORMAT_MESSAGE_FROM_SYSTEM+FORMAT_MESSAGE_ALLOCATE_BUFFER

call [FormatMessage]

push MB_OK
push esi
push edi
push NULL
call [MessageBoxEx]

push edi
call [LocalFree]

endlp

; ########################################################################
Posted on 2003-05-05 16:22:49 by jInuQ
You can see how to do the thing you're tryng to do in the DLL example in FASMW distribution (ERRORMSG.ASM file).
Posted on 2003-05-05 16:59:55 by Tomasz Grysztar
Thanks I got it working now.
Posted on 2003-05-05 18:37:16 by jInuQ