Unicorn with delicious cookie
Nous utilisons des cookies pour améliorer votre expérience de navigation. En savoir plus
Accepter
to the top
>
>
>
How can I know if the DWORD_PTR type is…

How can I know if the DWORD_PTR type is defined using ifdef?

23 Jan 2012
Author:

Memsize-types DWORD_PTR, INT_PTR, LONG_PTR, UINT_PTR and ULONG_PTR are intended to support 64-bit code and can safely store a pointer regardless of the platform capacity. But these types might be absent in old versions of Windows Platform SDK. The best solution of this problem is to update SDK to the latest version. However, if it is impossible for some reason, you can define these types by yourself.

Since these types are defined by the typedef specifier, there is no single reliable method to check their presence in the SDK version being used with the help of the #ifdef directive at the preprocessing step. However, the maximum value for these types is defined through MAXULONG_PTR in the basetsd.h file and you may do the following:

#if !defined(MAXULONG_PTR)
typedef DWORD DWORD_PTR;
#endif

References

Popular related articles

S'abonner

Comments (0)

close comment form
close form

Remplissez le formulaire ci‑dessous en 2 étapes simples :

Vos coordonnées :

Étape 1
Félicitations ! Voici votre code promo !

Type de licence souhaité :

Étape 2
Team license
Enterprise licence
** En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité
close form
Demandez des tarifs
Nouvelle licence
Renouvellement de licence
--Sélectionnez la devise--
USD
EUR
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
La licence PVS‑Studio gratuit pour les spécialistes Microsoft MVP
close form
Pour obtenir la licence de votre projet open source, s’il vous plait rempliez ce formulaire
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
I want to join the test
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
check circle
Votre message a été envoyé.

Nous vous répondrons à


Si l'e-mail n'apparaît pas dans votre boîte de réception, recherchez-le dans l'un des dossiers suivants:

  • Promotion
  • Notifications
  • Spam