Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to pass a date to a DLL?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00065737
Message ID:
00065793
Vues:
50
>>Peter,
>>
>>Thanks a lot. Here is what I found in the header file.
>>
>>typedef struct tagDPIDate
>>{
>> short jour;
>> short mois;
>> short annee;
>>} DPIDate, FAR * LPDPIDate;
>
>Each short is a 2-byte integer. So, you need to pass a string of 6 bytes. For the conversions from VFP numerical type to short 2-byte string:
>
>lcJour = chr(lnJour % 256) + chr(int(lnJour / 256))
>lcMois = chr(lnMois % 256) + chr(int(lnMois / 256))
>lcAnnee = chr(lnAnnee % 256) + chr(int(lnAnnee / 256))
>
>And pass the lcJour+lcMois+lcAnnee to the DLL function.
>
>Probably you already knew how to do this, but...
>
>Vlad

Of course, the purpose is to return stuff from the DLL function (unpack) as opposed to send stuff to it (pack). But this would let you send stuff to the Dll function if it required it...
Peter Stephens
Visual Records, Inc.

Lead Programmer for the general purpose record keeping system Visual Records. Written primarily in VFP 6.0 with a little C++.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform