That did it. Thanks.
I fool so feelish... When I teach Java at work, I always point out "somename(" tells you right away it's a function/method. Now I just need to remember that for PB too. (Using PBCC 4.04)
Announcement
Collapse
No announcement yet.
Using MessageBox API
Collapse
X
-
>retval = MessageBox hWnd, "Sprinkles on that?", _
> "The Sundae Shoppe", %MB_YESNOCANCEL+%MB_ICONQUESTION
That's a syntax error. When using a procedure as a function (returning a value), any procedure parameters must be enclosed by parentheses. (In 6x and 8x. In 7x there was a bug in the compiler which allowed you to get away with no parens).
Crap error message, but that IS your problem (assuming you are using 6x or 8x, version not shown).
BTW you should combine styles with the OR operator, not the '+' (addition) operator. You will 'get away with this' some of the time, but that will be plain old dumb luck.
MCM
Leave a comment:
-
Using MessageBox API
Code:' MessageBox app #INCLUDE "WIN32API.INC" 'include Windows API calls FUNCTION PBMAIN DIM retval AS LONG, hWnd AS LONG hWnd = GetDesktopWindow() retval = MessageBox hWnd, "Sprinkles on that?", _ "The Sundae Shoppe", %MB_YESNOCANCEL+%MB_ICONQUESTION PRINT retval WAITKEY$ END FUNCTION
I'm sure it's something simple, but I'm new to Windows programming.Tags: None
Leave a comment: