Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Question About API Calls translation between vb & vfp examp
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Question About API Calls translation between vb & vfp examp
Divers
Thread ID:
00767891
Message ID:
00767891
Vues:
55
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
Fil
Voir

Click here to load this message in the networking platform