> ## 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.

# IXtfInputClient::ConnectGamepad 메서드

> IXtfInputClient::ConnectGamepad 메서드

# IXtfInputClient::ConnectGamepad 메서드

가상 컨트롤러를 만들고 이에 대한 디바이스 식별자를 가져옵니다.

<a id="syntaxSection" />

## 구문

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

<a id="ID4EG" />

### 매개 변수

*pControllerId*\
형식: UINT64 \*

이 [IXtfInputClient](/reference/tools/xtf/xtfinput/classes/IXtfInputClient/ixtfinputclient-xtfinput-xbox-windows-t)의 디바이스 식별자를 받는 UINT64에 대한 포인터입니다.

<a id="ID4EP" />

### 반환 값

형식: HRESULT

HRESULT 성공 또는 오류 코드입니다.

<a id="remarks" />

## 설명

**ConnectGamepad**는 만들어진 각 가상 컨트롤러에 대해 시스템 리소스를 할당하고, [IXtfInputClient::SendGamepadReport](/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/sendgamepadreport-ixtfinputclient-xtfinput-xbox-windows-m)로 개발 콘솔에 입력을 보내는 데 사용될 가상 컨트롤러의 식별자를 반환합니다. 콘솔이 새 컨트롤러 등록을 완료하고 입력을 받을 준비가 되었는지 확인하려면 **ConnectGamepad**를 호출한 후 [SendGamepadReport](/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/sendgamepadreport-ixtfinputclient-xtfinput-xbox-windows-m)를 호출하기 전에 코드에서 2초를 기다려야 합니다. 이러한 시스템 리소스가 재사용을 위해 해제되도록 코드에서는 항상 **ConnectGamepad** 호출을 [DisconnectGamepad](/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/disconnectgamepad-ixtfinputclient-xtfinput-xbox-windows-m) 호출과 짝지어야 합니다. [IXtfInputClient::DisconnectAllGamepads](/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/disconnectgamepad-ixtfinputclient-xtfinput-xbox-windows-m)를 호출하여 모든 가상 컨트롤러 리소스를 한 번에 해제할 수도 있습니다.

<a id="requirements" />

## 요구 사항

**헤더:** xtfinput.h

**라이브러리:** xtfinput.lib

**지원 플랫폼:** Windows(XBOX 콘솔 도구용)

## 함께 보기

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


## Related topics

- [IXtfInputClient::DisconnectGamepad 메서드](/ko/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/disconnectgamepad-ixtfinputclient-xtfinput-xbox-windows-m.md)
- [IXtfInputClient::DisconnectAllGamepads 메서드](/ko/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/disconnectallgamepads-ixtfinputclient-xtfinput-xbox-windows-m.md)
- [IXtfInputClient::SendGamepadReport 메서드](/ko/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/sendgamepadreport-ixtfinputclient-xtfinput-xbox-windows-m.md)
- [IXtfInputClient::SendGamepadReportEx](/ko/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/ixtfinputclient_sendgamepadreportex.md)
- [IXtfInputClient::SendGamepadReportWithAudio](/ko/reference/tools/xtf/xtfinput/classes/IXtfInputClient/methods/ixtfinputclient_sendgamepadreportwithaudio.md)
