Hi,

How would use one structure within another? this doesnt work

struc POINT x,y

{

.x dw x+0

.y dw y+0

}

struc MSG hwnd,message,wParam,lParam,time,pt

{

hwnd dw hwnd+0

message dw message+0

wParam dw wParam+0

lParam dw lParam+0

time dw time+0

pt POINT <------------- or POINT <> either

}

Would be great if someone could help me thanx.

How would use one structure within another? this doesnt work

struc POINT x,y

{

.x dw x+0

.y dw y+0

}

struc MSG hwnd,message,wParam,lParam,time,pt

{

hwnd dw hwnd+0

message dw message+0

wParam dw wParam+0

lParam dw lParam+0

time dw time+0

pt POINT <------------- or POINT <> either

}

Would be great if someone could help me thanx.

You get the error because "pt" label is used as the macro argument, and when you don't provide this argument to "MSG" macro, it has empty value, so "pt POINT" becomes "POINT" and this instruciton is not recognized (because there's no standard macro of that name, only the structure macro, which need a label).

Here's the correct version:

Here's the correct version:

```
```

struc POINT x,y

{

.x dw x+0

.y dw y+0

}

struc MSG hwnd,message,wParam,lParam,time,pt

{

.hwnd dw hwnd+0

.message dw message+0

.wParam dw wParam+0

.lParam dw lParam+0

.time dw time+0

.pt POINT pt

}

hehe i shouldve seen that thanks for the help

Hi Privalov,

could u help me with just these two questions...

HWND TYPEDEF DWORD

does this work for fasm? i didnt see typedef in the text.because i get an error when using it in my code eg

hwnd HWND

and is there a SIZEOF macro that can be used or must i just use this

struc WNDCLASSEX style,lpfnWndProc,cbClsExtra,\

cbWndExtra,hInstance,hIcon,hCursor,\

hbrBackground,lpszMenuName,hIconSm,cbSize

{

.style dw style+0

.lpfnWndProc dw lpfnWndProc+0

.cbClsExtra dw cbClsExtra+0

.cbWndExtra dw cbWndExtra+0

.hInstance dw hInstance+0

.hIcon dw hIcon+0

.hCursor dw hCursor+0

.hbrBackground dw hbrBackground+0

.lpszMenuName dw lpszMenuName+0

.lpszClassName dw lpszClassName+0

.hIconSm dw hIconSm+0

.cbSize = $-.style

}

will this work?

thanks 4 your help

could u help me with just these two questions...

HWND TYPEDEF DWORD

does this work for fasm? i didnt see typedef in the text.because i get an error when using it in my code eg

hwnd HWND

and is there a SIZEOF macro that can be used or must i just use this

struc WNDCLASSEX style,lpfnWndProc,cbClsExtra,\

cbWndExtra,hInstance,hIcon,hCursor,\

hbrBackground,lpszMenuName,hIconSm,cbSize

{

.style dw style+0

.lpfnWndProc dw lpfnWndProc+0

.cbClsExtra dw cbClsExtra+0

.cbWndExtra dw cbWndExtra+0

.hInstance dw hInstance+0

.hIcon dw hIcon+0

.hCursor dw hCursor+0

.hbrBackground dw hbrBackground+0

.lpszMenuName dw lpszMenuName+0

.lpszClassName dw lpszClassName+0

.hIconSm dw hIconSm+0

.cbSize = $-.style

}

will this work?

thanks 4 your help

ASM is quite different from C/C++. For all windows variables (HWND, and all that other stuff) just use dd....example

hwnd dd 0 ; that works......

I'm not sure but I think you have to use the $-.firstvar thing...

hwnd dd 0 ; that works......

I'm not sure but I think you have to use the $-.firstvar thing...