News:

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

FormatMessage Error

Started by raleeper, August 14, 2011, 01:42:23 AM

Previous topic - Next topic

jj2007

The culprit is a simple ret... and imho this is is a big fat Masm bug.

Attached a perfectly working version, in .radix 10 or .radix 16.

raleeper

Success!  I am not certain exactly what did the trick, but I am pretty sure it was the error pointed out by jj2007 in Topic "Later versions of MASM - More Passes",

QuoteBy the way, the original problem in your TestP source was in line 185:

invoke WinMain, hinst, 0, cmdl, SW_SHOWDEFAULT ; bad
invoke WinMain, hinst, 0, offset cmdl, SW_SHOWDEFAULT ; good

Fixing that (or something) also fixed the problem described in Topic "Child Window Makes Parent Inactive - Another try".

Thanks to jj207 and all those who relied.

raleeper

Here's an example of an unwarned failure to assemble:

Working on test I had:
ChSty   EQU   WS_CHILD or WS_TILEDWINDOW

That failed to assemble w/ the message 'undefined..WS_TILEDWINDOW'
(I know I probably lack an include file - later for that)

So I changed it to:
ChSty   EQU   WS_CHILD or WS_OVERLAPPEDWINDOW

THAT failed to assemble w/ the message 'undefined..WS_TILEDWINDOW'
                                                                                      --------------------------

The change was properly shown in the testp.asm file.

So I thought, 'I don't have 2 testp.asm' files, do I'   Nope.

Next try - delete testp.asm and start over, check .asm before assy.

Nope.  Where could masm be getting the old testp.asm that it is apparently
using.

Maybe the problem is in the batch file I use to assemble.  It is:
[This seriously needs cleaning up - I'll do that soon]

g:\prog\masm32\bin\ml /c /coff /Cp /Fl /W2 /Zi /Ig:\prog\masm32\include g:\lfw\testp.asm >errs
if errorlevel 1 goto erfc
if errorlevel 1 goto erfc
g:\prog\masm32\bin\link /SUBSYSTEM:WINDOWS /LIBPATH:g:\prog\masm32\lib /DEBUG /DEBUGTYPE:CV testp.obj >>errs
IF errorlevel 1 goto erfc
exit
:erfc
type errs
pause
cd\
c:

I don't see anything wrong.

Does anyone have an idea as to what's happening?

Thanks, Robert

Gunner

As I don't use batch files myself... Most batch files I have seen delete the obj files if they exist before linking?
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com

Gunner

UM.... WS_TILEDWINDOW

you have WS_TILEWINDOW in your source

in one of your createwidows at least... you might be missing WS_TILEDWINDOW from you windows.inc?
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com

jj2007

The batch file could
- delete the previous executable
- delete the previous obj file
- test the errorlevel variable after assembly (but attention, not all assemblers get it right)
MasmBasic users could check \masm32\RichMasm\Res\bldallRM.bax - a true source of inspiration :wink - and it almost never fails when loading a *.asm file and hitting the Assemble & Link & Run button; actually I haven't seen it choking for ages. But it looks pretty daunting I'm afraid.

raleeper

Quote from: Gunner on August 18, 2011, 09:29:38 PM
As I don't use batch files myself... Most batch files I have seen delete the obj files if they exist before linking?

How do you assemble?  My method goes back to the days of DOS and I'd love something better.

Thanks

Gunner

Quote from: raleeper on August 18, 2011, 09:42:02 PM
Quote from: Gunner on August 18, 2011, 09:29:38 PM
As I don't use batch files myself... Most batch files I have seen delete the obj files if they exist before linking?

How do you assemble?  My method goes back to the days of DOS and I'd love something better.

Thanks

The IDE I use handles all that for me  :bg
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com

raleeper

Quote from: jj2007 on August 18, 2011, 09:40:36 PM
The batch file could
- delete the previous executable
- delete the previous obj file

I'll try it.  The .obj file is an obvious (now that you mention it) suspect.
But I don't want to do that generally,  I want the files for the last successful assembly always available.
Quote
MasmBasic users could check \masm32\RichMasm\Res\bldallRM.bax - a true source of inspiration :wink - and it almost never fails when loading a *.asm file and hitting the Assemble & Link & Run button; actually I haven't seen it choking for ages. But it looks pretty daunting I'm afraid.

raleeper

Quote from: Gunner on August 18, 2011, 09:45:55 PM

The IDE I use handles all that for me  :bg
Do you have an estimate as to how long it would take one who doesn't know what an IDE is to get up and running with them?

raleeper

Quote from: Gunner on August 18, 2011, 09:36:46 PM
UM.... WS_TILEDWINDOW

you have WS_TILEWINDOW in your source

in one of your createwidows at least... you might be missing WS_TILEDWINDOW from you windows.inc?
Ah!. You have a sharp eye.
Thanks

Gunner

Quote from: raleeper on August 18, 2011, 09:57:19 PM
Quote from: Gunner on August 18, 2011, 09:45:55 PM

The IDE I use handles all that for me  :bg
Do you have an estimate as to how long it would take one who doesn't know what an IDE is to get up and running with them?

I use RadASM, you can find it here: http://www.masm32.com/board/index.php?board=11.0...  Takes 4.3 minutes :-) to set up...  you just tell it some paths in options and you are ready to go..
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com

raleeper

Quote from: raleeper on August 18, 2011, 09:53:09 PM
Quote from: jj2007 on August 18, 2011, 09:40:36 PM
The batch file could
- delete the previous executable
- delete the previous obj file

Nope.
I manually deleted all the testp files and masm still dredged up from somewhere the file w/ TILEWINDOW.  I'm going to restart the cmptr.

Thanks.

I'll try it.  The .obj file is an obvious (now that you mention it) suspect.
But I don't want to do that generally,  I want the files for the last successful assembly always available.
Quote
MasmBasic users could check \masm32\RichMasm\Res\bldallRM.bax - a true source of inspiration :wink - and it almost never fails when loading a *.asm file and hitting the Assemble & Link & Run button; actually I haven't seen it choking for ages. But it looks pretty daunting I'm afraid.

raleeper

Quote from: Gunner on August 18, 2011, 10:11:45 PM
Quote from: raleeper on August 18, 2011, 09:57:19 PM
Quote from: Gunner on August 18, 2011, 09:45:55 PM

The IDE I use handles all that for me  :bg
Do you have an estimate as to how long it would take one who doesn't know what an IDE is to get up and running with them?

I use RadASM, you can find it here: http://www.masm32.com/board/index.php?board=11.0...  Takes 4.3 minutes :-) to set up...  you just tell it some paths in options and you are ready to go..

Ah! Plus no doubt a couple of hours for learning and mistakes, but still no problem.  I'll try it.

Thanks!

jj2007

Quote from: Gunner on August 18, 2011, 09:36:46 PM
in one of your createwidows at least...

That sounds dangerous, man. So what would CreateWidowsEx do?