LJ wrote:How do I tell Purebasic to look in c:\fasm\INCLUDE\ for all the Win32.INC files?
type
set include=c:\fasm\include at the Windows command prompt to set the required environment variable.
(also in XP you can use Control Panel -> System -> Advanced -> Environment Variables. (can't remember if it's the same in '98 ))
However, when I try to compile
!include '%include%/win32ax.inc'
in PB it finds the win32ax.inc but then stops with an "unexpected instruction" error.
Alternative method of opening a messagebox with inline assembly is:
Code: Select all
!extrn "__imp__MessageBoxA@16" as MessageBox:dword
PUSH 0
PUSH _caption
PUSH _message
PUSH 0
CALL [MessageBox]
RET
!_caption db "Win32 Assembly",0
!_message db "Hi! I'm the example program!",0
But regarding Win32 API functions I think I prefer the PureBasic way:
Code: Select all
MessageBox_(HWND_DESKTOP,"Hi! I'm the example program!","Win32 PureBasic",MB_OK)
As far as I can tell (which isn't very far when it comes to assembly language) the
invoke thing is like the FASM equivalent to PureBasic's trailing-underscore-after-the-function-name method, so I don't know if there's any benfit to using the win32ax.inc stuff from within PureBasic.