News:

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

Main Menu

error msg?

Started by shankle, June 26, 2012, 12:49:14 AM

Previous topic - Next topic

shankle

Getting the following error message:
  "use square brackets to address memory, address , offset to get address"

     This is the offending code:  cmp D[iMsg], WM_CREATE

    Wndproc FRAME hWnd, iMsg, wParam,lParam
The Wndproc is before the cmp.

This same code appears in Donkeys Except and FontDlg.

Ryan

What is D?

cmp iMsg, WM_CREATE
should work.

shankle

"D" in GoAsm represents a DWORD

satpro

Do you have WM_CREATE defined?  It's (I'm pretty sure) in winuser.h
GoAsm thinks WM_CREATE is a label in your program.

Do you have these in your main assembly file?:

#define LINKFILES
#include "windows.h"

(winuser.h will be loaded by windows.h)

Ryan

Ah.  I didn't realize I was in GoAsm.

Carry on.

satpro

#5
shankle,
Look through those header files.  It really helps later.  For example, next time you get that message you'll know it was something you forgot to define.  If you aren't using them now--get Donkey's headers.
http://donkeysstable.com/

shankle

#6
Hi Satpro,
No I did not have them defined. Was trying to use "EQUs" to do the job.
I included them in the program and got other opportunities.
Have no idea where #define linkfiles is coming from.

Anyway here is what I added to my program.
  Const Section
  #include winuser.h
  #include windows.h
  #define linkfiles

These are the errors that windows.h caused:
  Line 299 of the include file Windows.h could not open file #include "windef.h"

  Line 303 of the include file windows.h - unexpected material <ntddi-win9xall>.

  WM_CREATE and others are in "winuser.h". Got the following error in winuser.h:
  "winuser.h - could not evaluate expression in conditional directive - winver".

Is it possible that these files don't work in Windows 7??????

  Nothing is ever easy.....
  Thank you for helping - I'm so green

wjr

The files do work on Windows 7. Windows.h should be listed first, and as mentioned in Reply #3, winuser.h will be included so you do not need that line. Also, symbols are case sensitive, so use LINKFILES - this is a link switch which "If defined passes the name of the appropriate DLL to GoLink at compile time". Order is important too, so this needs to be defined before including windows.h.

Yuri

Quote from: shankle on June 26, 2012, 04:38:20 AM
Anyway here is what I added to my program.
  Const Section
  #include winuser.h
  #include windows.h
  #define linkfiles
I think it's better to put these includes and defines before all sections.

dedndave

you shouldn't need to open a CONST section for those
- nor for equates (i see that quite often   :P )

shankle

I have disabled "windows.h". If I run with it I get errors in windows.h.
I have gone into the program and added an "A" to every API in the program.
When I link they all show up as unresolved.
More than that these items also show up as unresolved:
cbsize,  hwnd, msg, msh.param, hdc, FF_ROMAN, hdcPrn
??

wjr

LINKFILES is used within the header files. Without "windows.h", since not every API function has an ANSI/Unicode variant, it sounds like you need to list the required DLL(s) that you import from (ex. Kernel32.dll, User32.dll, Gdi32.dll) to the command line for GoLink.

FF_ROMAN is defined in the header files (wingdi.h). As for the rest, those look more like they should have been defined within your source files.

shankle

Hi Wjr,
Thanks for helping.
If I understand you correctly, that would make the GoAsm command line Huge. There are about
two dozen of them. I really don't think I understand.
I will check out the wingdi.h for FF_ROMAN.

wjr

Correct - if you have that many and are not using the header files with LINKFILES, some alternatives to simplify things would be (see GoAsm+GoLink documentation for details) use of the following in your source:

#dynamiclinkfile path/filename

or a command file for use with GoLink:

GoLink @commands.txt

shankle

Thank you WJR for your patience.
I just found the GOLINK manual. Thought every bit of documentation was in the
GoAsm manual. No wonder I was having problems.