> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Méthode IXtfInputClient::ConnectGamepad

> Méthode IXtfInputClient::ConnectGamepad

# Méthode IXtfInputClient::ConnectGamepad

Crée une manette virtuelle et obtient son identificateur d'appareil.

<a id="syntaxSection" />

## Syntaxe

```cpp theme={null}
public:
HRESULT ConnectGamepad(
         UINT64 *pControllerId
)  
```

<a id="ID4EG" />

### Paramètres

*pControllerId*\
Type : UINT64 \*

Pointeur vers un UINT64 qui reçoit l'identificateur d'appareil de cet objet [IXtfInputClient](/fr/reference/tools/xtf/xtfinput/classes/IXtfInputClient/ixtfinputclient-xtfinput-xbox-windows-t).

<a id="ID4EP" />

### Valeur de retour

Type : HRESULT

Code de réussite ou d'erreur HRESULT.

<a id="remarks" />

## Remarques

**ConnectGamepad** alloue des ressources système pour chaque manette virtuelle créée et retourne l'identificateur de la manette virtuelle qui sera utilisé pour envoyer des entrées à une console de développement avec [IXtfInputClient::SendGamepadReport](/fr/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/sendgamepadreport-ixtfinputclient-xtfinput-xbox-windows-m). Votre code doit attendre 2 secondes après l'appel de **ConnectGamepad** avant d'appeler [SendGamepadReport](/fr/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/sendgamepadreport-ixtfinputclient-xtfinput-xbox-windows-m), afin de s'assurer que la console a terminé l'inscription de la nouvelle manette et est prête à accepter des entrées. Votre code doit toujours associer un appel à **ConnectGamepad** à un appel à [DisconnectGamepad](/fr/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/disconnectgamepad-ixtfinputclient-xtfinput-xbox-windows-m) pour garantir que ces ressources système sont libérées en vue de leur réutilisation. Vous pouvez également appeler [IXtfInputClient::DisconnectAllGamepads](/fr/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/disconnectgamepad-ixtfinputclient-xtfinput-xbox-windows-m) pour libérer toutes les ressources des manettes virtuelles en une seule fois.

<a id="requirements" />

## Configuration requise

**En-tête :** xtfinput.h

**Bibliothèque :** xtfinput.lib

**Plateformes prises en charge :** Windows (pour les outils de console XBOX)

## Voir aussi

[XtfInput](/fr/reference/tools/xtf/xtfinput/xtfinput-xbox-microsoft-n)\
[IXtfInputClient](/fr/reference/tools/xtf/xtfinput/classes/IXtfInputClient/ixtfinputclient-xtfinput-xbox-windows-t)\
[IXtfInputClient::ConnectGamepad](/fr/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/connectgamepad-ixtfinputclient-xtfinput-xbox-windows-m)\
[IXtfInputClient::DisconnectGamepad](/fr/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/disconnectgamepad-ixtfinputclient-xtfinput-xbox-windows-m)\
[IXtfInputClient::DisconnectAllGamepads](/fr/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/disconnectgamepad-ixtfinputclient-xtfinput-xbox-windows-m)


## Related topics

- [IXtfInputClient::ConnectGamepad Method](/zh-CN/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/connectgamepad-ixtfinputclient-xtfinput-xbox-windows-m.md)
- [IXtfInputClient::ConnectGamepad (método)](/es/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/connectgamepad-ixtfinputclient-xtfinput-xbox-windows-m.md)
- [IXtfInputClient::ConnectGamepad 메서드](/ko/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/connectgamepad-ixtfinputclient-xtfinput-xbox-windows-m.md)
- [IXtfInputClient::ConnectGamepad メソッド](/ja-jp/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/connectgamepad-ixtfinputclient-xtfinput-xbox-windows-m.md)
- [IXtfInputClient::DisconnectGamepad (método)](/es/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/disconnectgamepad-ixtfinputclient-xtfinput-xbox-windows-m.md)
