memory access error .. instruction at "address" referenced memory at "".... 
Author Message
 memory access error .. instruction at "address" referenced memory at ""....

the instruction at ""0x0faa3b0a" referenced memory
at "0xfffffffc". the memory could not be "read".
----------------------------------------------------------
The above error is reported while running a program that i
am working on. It seems apparent that it is because of an
API call and its calling function included in one of my
modules.
----------------------------------------------------------
the api call is included to override the default textbox
right click menu. code for that overriding process is:

Public Declare Function GetFocus Lib "user32" () As Long

Public 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

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

Public Const GWL_WNDPROC As Long = (-4)
Public Const WM_RBUTTONUP As Long = &H205
Public defWndProc As Long

Public Sub Hook(hwnd As Long)

   If defWndProc = 0 Then

      defWndProc = SetWindowLong(hwnd, _
                                 GWL_WNDPROC, _
                                 AddressOf WindowProc)
   End If
End Sub

Public Sub UnHook(hwnd As Long)

    If defWndProc > 0 Then

      Call SetWindowLong(hwnd, GWL_WNDPROC, defWndProc)
      defWndProc = 0

   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_RBUTTONUP

            ' my menu that i want instead of the right
click menu
            frmMain.PopupMenu frmMain.mnuObjPopUp

        Case Else

            WindowProc = CallWindowProc(defWndProc, _
                                        hwnd, _
                                        uMsg, _
                                        wParam, _
                                        lParam)
    End Select

End Function

--------------------------------------------------------

in my form i am required to call "hook" each textbox
clicked and unhook when it no longer has focus. I have a
control array of textboxes whose ubound changes at runtime.

please advise how to implement this in the best possible
manner and to avoid this error completely.

thanks very very much



Mon, 02 Feb 2004 23:40:31 GMT  
 memory access error .. instruction at "address" referenced memory at ""....
There was a bug that gave this same memory error that was
fixed in SP 3.  Make sure you have the latest SP's
installed.

Wendy

Quote:
>-----Original Message-----
>the instruction at ""0x0faa3b0a" referenced memory
>at "0xfffffffc". the memory could not be "read".
>----------------------------------------------------------
>The above error is reported while running a program that
i
>am working on. It seems apparent that it is because of an
>API call and its calling function included in one of my
>modules.
>----------------------------------------------------------
>the api call is included to override the default textbox
>right click menu. code for that overriding process is:

>Public Declare Function GetFocus Lib "user32" () As Long

>Public 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

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

>Public Const GWL_WNDPROC As Long = (-4)
>Public Const WM_RBUTTONUP As Long = &H205
>Public defWndProc As Long

>Public Sub Hook(hwnd As Long)

>   If defWndProc = 0 Then

>      defWndProc = SetWindowLong(hwnd, _
>                                 GWL_WNDPROC, _
>                                 AddressOf WindowProc)
>   End If
>End Sub

>Public Sub UnHook(hwnd As Long)

>    If defWndProc > 0 Then

>      Call SetWindowLong(hwnd, GWL_WNDPROC, defWndProc)
>      defWndProc = 0

>   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_RBUTTONUP

>            ' my menu that i want instead of the right
>click menu
>            frmMain.PopupMenu frmMain.mnuObjPopUp

>        Case Else

>            WindowProc = CallWindowProc(defWndProc, _
>                                        hwnd, _
>                                        uMsg, _
>                                        wParam, _
>                                        lParam)
>    End Select

>End Function

>--------------------------------------------------------

>in my form i am required to call "hook" each textbox
>clicked and unhook when it no longer has focus. I have a
>control array of textboxes whose ubound changes at
runtime.

>please advise how to implement this in the best possible
>manner and to avoid this error completely.

>thanks very very much
>.



Fri, 06 Feb 2004 16:19:22 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Access "Out of Memory" Error Message

2. Instruction error @ referenced memory

3. "Out of memory" error

4. "Out of memory" error message

5. Compiling Error "Program-memory overflow"

6. "Not enough memory" error during compile

7. runtime error 7 "not enough memory"

8. "Out of memory" error message

9. VB5 "Out of Memory" error

10. runtime error 7 "Out of memory"

11. OLE and "Out Of Memory" Error

12. VBScript InputBox "Out of memory" error

 

 
Powered by phpBB® Forum Software