Author Topic: error msg?  (Read 68989 times)

shankle

  • Member
  • ****
  • Posts: 835
error msg?
« on: June 26, 2012, 12:49:14 AM »
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

  • Guest
Re: error msg?
« Reply #1 on: June 26, 2012, 02:35:39 AM »
What is D?

Code: [Select]
cmp iMsg, WM_CREATEshould work.

shankle

  • Member
  • ****
  • Posts: 835
Re: error msg?
« Reply #2 on: June 26, 2012, 02:42:00 AM »
"D" in GoAsm represents a DWORD

satpro

  • Member
  • **
  • Posts: 116
Re: error msg?
« Reply #3 on: June 26, 2012, 03:03:04 AM »
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

  • Guest
Re: error msg?
« Reply #4 on: June 26, 2012, 03:06:33 AM »
Ah.  I didn't realize I was in GoAsm.

Carry on.

satpro

  • Member
  • **
  • Posts: 116
Re: error msg?
« Reply #5 on: June 26, 2012, 03:07:22 AM »
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/
« Last Edit: April 30, 2013, 01:33:29 PM by Donkey »

shankle

  • Member
  • ****
  • Posts: 835
Re: error msg?
« Reply #6 on: June 26, 2012, 04:38:20 AM »
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
 
« Last Edit: June 26, 2012, 06:46:11 AM by shankle »

wjr

  • Member
  • **
  • Posts: 208
    • WJR's website
Re: error msg?
« Reply #7 on: June 26, 2012, 11:20:26 AM »
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

  • Member
  • **
  • Posts: 175
Re: error msg?
« Reply #8 on: June 26, 2012, 12:35:00 PM »
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

  • Member
  • *****
  • Posts: 8823
  • Still using Abacus 2.0
    • DednDave
Re: error msg?
« Reply #9 on: June 26, 2012, 02:07:39 PM »
you shouldn't need to open a CONST section for those
- nor for equates (i see that quite often   :P )

shankle

  • Member
  • ****
  • Posts: 835
Re: error msg?
« Reply #10 on: June 28, 2012, 12:25:50 AM »
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

  • Member
  • **
  • Posts: 208
    • WJR's website
Re: error msg?
« Reply #11 on: June 28, 2012, 10:37:21 AM »
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

  • Member
  • ****
  • Posts: 835
Re: error msg?
« Reply #12 on: June 28, 2012, 11:09:38 AM »
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

  • Member
  • **
  • Posts: 208
    • WJR's website
Re: error msg?
« Reply #13 on: June 28, 2012, 11:58:19 AM »
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

  • Member
  • ****
  • Posts: 835
Re: error msg?
« Reply #14 on: June 28, 2012, 09:43:01 PM »
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.