Information générale
Catégorie:
Fonctions Windows API
Titre:
Question About API Calls translation between vb & vfp examp
I am trying to use a API Call SetWindowLong & CallWindowProc function in Visual Foxpro. Visual Foxpro does not like the AddressOf WindowProc. My understand of API call come from Visual Basic. Because of that I may have some concept wrong when trying it in Visual Foxpro. Here is some code that I am trying to translate between Visual Basic Examples to Visual Foxpro.
' Visual Basic
lpPrevWndProc = SetWindowLong(gHW, GWL_WNDPROC, AddressOf WindowProc)
' My Visual Foxpro attempt to convert the call
lpPrevWndProc = SetWindowInteger(gHW, GWL_WNDPROC, @WindowProc)
' Visual Basic Function
Function WindowProc(ByVal hw As Long, ByVal uMsg As _
Long, ByVal wParam As Long, ByVal lParam As Long) As _
Long
Debug.Print "Message: "; hw, uMsg, wParam, lParam
WindowProc = CallWindowProc(lpPrevWndProc, hw, _
uMsg, wParam, lParam)
End Function
' Visual Foxpro attempt at converting the call
Function WindowProc
PARAMETERS hw,uMsg,wParam, lParam
LOCAL lnWindowProc as Long
DEBUGOUT "Message: " + " " + hw + " " + uMsg + " " + wParam + " " + lParam
lnWindowProc = CallWindowProc(lpPrevWndProc, hw, uMsg, wParam, lParam)
RETURN lnWindowProc
EndFunc
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement