Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to pass wfAttributes to this DLL?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00065847
Message ID:
00065856
Vues:
36
>Another one...
>
>Extracted from the the help file:
>
>WORD DPICreateTiers( HSOC hSociete,
> LPSTR szCompte,
> LPSTR szIntitule,
> WORD wfAttributes,
> LPSTR szBudget,
> LPSTR szTiers,
> LPSTR szAd1,
> LPSTR szAd2,
> LPSTR szAd3,
> LPSTR szCodePost,
> LPSTR szVille,
> LPSTR szTel,
> LPSTR szFax,
> LPSTR szReglem,
> LPSTR szBanque);
>
>
>Paramètres
>hSoc handle de la société. Ce handle est renvoyé par DPIOpenSociete.
>szCompte numéro du compte (cf. test sur les numéros de comptes)
>szIntitulé intitulé du compte
>wfAttributes attributs du compte
> DPICPT_LETTRABLE compte lettrable
> DPICPT_UTILISABLE compte utilisable
> DPICPT_ECHEANCE saisie de date déchéance
> DPICPT_POINTAGE saisie de numéro de pointage
> DPICPT_QUANTITE saisie de quantité
> ces valeurs sont cumulable par un OU (translation: these values are cumulable by an OR)
>
>szBudget budget
>szTiers nom du tiers
>szAd1 adresse 1
>szAd2 adresse 2
>szAd3 adresse 3
>szCodePost code postal
>szVille ville
>szTel numéro de téléphone
>szFax numéro de fax
>szReglem mode de règlement
>szBanque nom de la banque
>
>
>Valeurs de retour
>Code derreur
>
>Remarques
>szBudget, sztiers, szAd1, szAd2, szAd3, szCodePost, szVille, szTel, szFax,
>szReglem et szBanque peuvent être NULL ou vides.
>
>
>// types de comptes Value I want in this field
>#define DPICPT_LETTRABLE 0x0001 1
>#define DPICPT_UTILISABLE 0x0002 1
>#define DPICPT_ECHEANCE 0x0004 1
>#define DPICPT_POINTAGE 0x0008 1
>#define DPICPT_QUANTITE 0x0010 0
>
>I have this function running well, except for the wfAttributes part, for which I don't how to cumulate the values.
>Question: What value should I pass to wfAttributes to get the 5 following fields defined as I want?
>
>José

Each DPICPT_... is an integer constant:

DPICPT_LETTRABLE = 1
DPICPT_UTILISABLE = 2
DPICPT_ECHEANCE = 4
DPICPT_POINTAGE = 8
DPICPT_QUANTITE = 16

You can combine them in 2 ways:
1. You can add the values you want. For example: DPICPT_UTILISABLE + DPICPT_ECHEANCE
2. You can use a BITOR(DPICPT_UTILISABLE, DPICPT_ECHEANCE)

Obviously, if you want to combine more than 2 options, just apply the same operation (+ or BITOR()) once for each option you want.

Although the sum (+) gives exactly the same result here and you can use it safely, I would recommend you to use the BITOR() because this is the real operation you nead. And it's a little less risky: if, by mistake, you add twice the same option, the result will be completly wrong. If you do the same mistake with the BITOR() nothing wrong happens!

Vlad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform