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:
00065743
Vues:
42
>Hi,
>
>Does someone have an idea on how I should pass a date to this DLL?
>I use it to directly write into an accounting program.
>
>Here is what the help says:
>
>WORD DPIGetSysDate( HSOC hSoc,
> WORD wType,
> LPDPIDate lpDate
> );
>
>Parameters
>hSoc handle off the company (no problem with this one)
>Wtype type of date whished (no problem, these are constants)
> DPIDTE_EMPTY date vide
> DPIDTE_TODAY date du jour
> DPIDTE_DEBEXER début dexercice
> DPIDTE_FINEXER fin dexercice
> DPIDTE_DEBSAISIE début de saisie
> DPIDTE_FINSAISIE fin de saisie
>lpDate pointeur on a date <<< here is the problem
>
>Returns: error Code
>
>
>José
LPDPIDate lpDate
is a memory pointer to a date. You will need to find out what the C language structure and size for the date is before you can know what the returned value is.

Here is some sample code:
<font color="#0000FF">local</font> cStr, nErr
<font color="#0000FF">declare integer</font> DPIGetSysDate <font
color="#0000FF">in</font> YourLibraryName.Dll <font
color="#0000FF">integer</font> hSoc, <font color="#0000FF">integer</font> wType, <font
color="#0000FF">string</font> @ lpDate
cStr = <font color="#0000FF">replicate</font>(<font
color="#0000FF">chr</font>(0), nLengthOfDateStruct) <font
color="#008000">&amp;&amp; Fill in with your own date struct</font>
nErr = DPIGetSysDate(m.YourhSoc, m.YourwType, @cStr) &amp;&amp; <font
color="#0000FF">Call the routine</font>
<font color="#0000FF">** Interpret your results...</font>
The next step is to intrepret the results which can be intersting. You will need to know the exact spec for DPIDate which should be in a C++ header file (has a .h extension). Look for the line with struct DPIDate { ... and get everything until the end curly brace.

After you send more information, maybe I can help more.

HTH,
Peter
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