VBA & API function calls in break mode

VBA & API function calls in break mode

mdhutchinson
Advisor Advisor
371 Views
1 Reply
Message 1 of 2

VBA & API function calls in break mode

mdhutchinson
Advisor
Advisor
Can anyone else confirm this...
That if API function calls are used to "user32" ... this will crash VBA AND AutoCAD (2007) when VBAIDE is in break mode...
(see below example)

Is there a alternate way of debugging code involving API calls OTHER than in break mode... an idea of the top of my head is with DEBUG.PRINT or MSGBOX "Stop" ...
I don't know if it is only the break mode that does this or if it is STOP processing pick in VBAIDE.

Private Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function SendMessageAny Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

Message was edited by: hutch

isn't there an API Function guru here... that could provide some insight into this?
0 Likes
372 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
I am no guru on API. I can say that I have API code like this:

Public Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal vKey As Long) As Integer
'***App Window Constants***
Public Const WIN_NORMAL = 1 'Open Normal
Public Const WIN_MAX = 3 'Open Maximized
Public Const WIN_MIN = 2 'Open Minimized
Private Const MAX_PATH As Integer = 255


I cannot insert a break point in it, but I can in the functions that use it.
0 Likes