Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stack Violation 1

Status
Not open for further replies.

webpager

Programmer
Mar 27, 2001
166
GB
The following code gives me an error:-

Stack Violation. Please check the parameters

-----------------------------------------------------
SENDMESSAGEa=REGFN("SendMessage","LLL","L")

m_user=256
kommand=40045

RETURN_VALUE=CALLFN(SENDMESSAGEa,HWNDWINAMP,m_user,kommand)
----------------------------------------------------
There is a lot more code than this but these are the relevant lines.

There is no mention of Stack Violation in my reference material so could anyone suggest what I am doing wrong.
 
P.S.
HWNDWINAMP is defined as the window handle of the receiving screen.
 
Hi my friend,
First of all you don't have to use FoxTools REGFN(),CALLFN()
To register SendMessage() Win32 API function. You can declare it like this
Code:
DECLARE INTEGER SendMessage IN WIN32API ;
   INTEGER hWnd, ;
   INTEGER Msg, ;
   INTEGER wParameter, ;
   INTEGER lParameter
You can find hWnd using
Code:
DECLARE INTEGER FindWindow IN Win32API STRING, STRING
hWnd = FindWindow(0,"America Online") && America Online is just an example
Then you have to assign the right number for your message "WM_Message" and send it using
Code:
=SendMessage(hWnd, WM_Message, 0, 0)
Finally and most important, the value of your message has to be a Hex number not decimal which I think it was you problem when the compiler thought that 40045 is a Hex number,which if true it needs more than 32 bits to store this number that is why you got stack overflow error. So find the Hex number of your message or its constant and if you got this message parameter value 40045 convert it to 0X9C6D in FoxPro
Thanks and good luck Walid Magd
Engwam@Hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top