Path: ...!news.mixmin.net!weretis.net!feeder8.news.weretis.net!news.imp.ch!news.alphanet.ch!alphanet.ch!.POSTED!not-for-mail From: DrPi <314@drpi.fr> Newsgroups: fr.comp.lang.ada Subject: =?UTF-8?B?UmU6IFF1ZXN0aW9uIGRlIGfDqW7DqXJpY2l0w6k=?= Date: Sat, 2 Sep 2023 09:52:58 +0200 Organization: Posted through news.alphanet.ch Message-ID: References: <26366041-5cd3-4ccf-b1ac-a937a1c53f3en@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sat, 2 Sep 2023 07:53:03 -0000 (UTC) Injection-Info: shakotay.alphanet.ch; posting-account="dr.pi"; logging-data="3726"; mail-complaints-to="usenet@alphanet.ch"; posting-host="bda8ab3c43e8ad8cb626bfebe8390999.nnrp.alphanet.ch" User-Agent: Mozilla Thunderbird Cancel-Lock: sha256:2DGE3cHb47u7wi4WEulwjGdM2rMr1krgm5e9yOXYQKM= Content-Language: fr In-Reply-To: Bytes: 2629 Lines: 24 Le 01/09/2023 à 20:42, Gautier write-only address a écrit : > Que dis-tu du code ci-dessous? J'y ait pensé mais j'espérais une écriture plus "intelligente". > Une question à mon tour: pourquoi le choix 32, 64, 128 (puissances de deux) puis 255 (=2^8 - 1) et pourquoi +2 pour la longueur des trois premiers tableaux et +1 pour le dernier? > Je ne sais pas :p J'essaie de m'interfacer sur une DLL dont le fichier d'entête associé définit les choses comme ça. // String types. These include room for the strings and a NULL char, // or, on the Mac, a length byte followed by the string. // TW_STR255 must hold less than 256 chars so length fits in first byte. #if defined(__APPLE__)-- cf: Mac version of TWAIN.h typedef unsigned char TW_STR32[34], FAR *pTW_STR32; typedef unsigned char TW_STR64[66], FAR *pTW_STR64; typedef unsigned char TW_STR128[130], FAR *pTW_STR128; typedef unsigned char TW_STR255[256], FAR *pTW_STR255; #else typedef char TW_STR32[34], FAR *pTW_STR32; typedef char TW_STR64[66], FAR *pTW_STR64; typedef char TW_STR128[130], FAR *pTW_STR128; typedef char TW_STR255[256], FAR *pTW_STR255; #endif