Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 216
Default Why I get "Stack overflow" err 28

I'm using, in an excel2000 sheet, the following code to
get mouse control:

Private Declare Function SetWindowLong Lib "user32"
Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex
As Long, ByVal dwNewLong As Long) As Long

Private Declare Function CallWindowProc Lib "user32"
Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long,
ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As
Long, ByVal lParam As Long) As Long

Private Declare Function GetCursorPos Lib "user32" (point
As POINTAPI) As Long

Public Sub captureInput(App As Application)
If Not isEqual(GetWindowLong(App.hwnd, GWL_WNDPROC),
AddressOf WindowProc) Then
Set aW = App.ActiveWindow
PrevProc = SetWindowLong(App.hwnd, GWL_WNDPROC,
AddressOf WindowProc)
End If
End Sub

Public Function WindowProc(ByVal hwnd As Long, ByVal uMsg
As Long, ByVal wParam As Long, ByVal lParam As Long) As
Long
Select Case uMsg
Case WM_MOUSEMOVE
If Not is_Working Then
is_Working = True: GetCursorPos point
Call handleTypes(point)
is_Working = False
End If
End Select
'-----------------------------
WindowProc = CallWindowProc(PrevProc, hwnd, uMsg,
wParam, lParam)
End Function

.........
In an Workbook_Open event:
Call captureInput(App)
.........

Everything functions well until I put everything in an Add-
in. Then I get this error 28 - Stack overflow

Thanks in advance!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
"Out of Stack Space" Macro Error Adam Excel Discussion (Misc queries) 3 July 2nd 07 07:10 PM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
Run Time Error "28" - Out of stack space? Tom Ogilvy Excel Programming 0 September 12th 03 04:43 PM


All times are GMT +1. The time now is 10:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"