Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to declare Visual Basic TYPE STATEMENT in Foxpro?
Message
De
27/01/2001 05:28:58
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00469364
Message ID:
00469367
Vues:
16
>When looking into different API's, the syntax of writing codes are most often in Visual C or Visual Basic. One of my problems is how to understand how to write code in Foxpro where the parameter in the API function consists of more than one element. In Visual Basic there is the TYPE STATEMENT.
>For example:
>Private Type NETRESOURCE
> dwScope As Long
> dwType As Long
> dwDisplayType As Long
> dwUsage As Long
> lpLocalName As String
> lpRemoteName As String
> lpComment As String
> lpProvider As String
>End Type
>
>What is the syntax in the Foxpro language?

In VFP unfortunately there isn't STRUCT/UNION etc styles. However you could build the whole struct as a string. ie : For this struct you need at least :
4*long(4bytes) + enough space for string buffers. As I sense you would get this as an output parameter. Then :
lpResponse = space(4*4+256*4) && Simply assumed 256 bytes buffer would be more than sufficient for strings
could be used. At return it's your responsibility to decode lpResponse to get returned values. However it's cumbersome and you might want to look Christof's STRUC class in files section. It provides a way to create and get back struc types.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform