Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Question About API Calls translation between vb & vfp ex
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00767891
Message ID:
00767895
Vues:
11
Clarence,

FoxPro doesn't have built-in support for callback functions. You can read more about that at http://fox.wikis.com/wc.dll?Wiki~CallbacksAndEvents~WIN_COM_DNA.

>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
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform