Metode IDirectInputJoyConfig8::EnumTypes (dinputd.h)

Metode IDirectInputJoyConfig8::EnumTypes menghitung jenis joystick yang saat ini didukung oleh DirectInput. Jenis joystick menggambarkan bagaimana DirectInput harus berkomunikasi dengan perangkat joystick. Ini termasuk informasi seperti keberadaan dan lokasi masing-masing sumbu dan jumlah tombol yang didukung oleh perangkat.

Sintaks

HRESULT EnumTypes(
  LPDIJOYTYPECALLBACK unnamedParam1,
  LPVOID              unnamedParam2
);

Parameter

unnamedParam1

Menunjuk ke fungsi panggilan balik yang ditentukan aplikasi yang menerima jenis joystick DirectInput. Lihat bagian Keterangan untuk prototipe fungsi.

unnamedParam2

Menentukan nilai yang ditentukan aplikasi 32-bit untuk diteruskan ke fungsi panggilan balik. Nilai ini dapat berupa nilai 32-bit apa pun; ini diprototi sebagai LPVOID untuk kenyamanan.

Nilai kembali

Mengembalikan DI_OK jika berhasil; jika tidak, mengembalikan salah satu nilai kesalahan COM berikut:

Menampilkan kode Deskripsi
DIERR_INVALIDPARAM
Satu atau beberapa parameter tidak valid.

Keterangan

Panggilan balik ini menerima jenis joystick DirectInput sebagai akibat dari panggilan ke metode IDirectInputJoyConfig8::EnumTypes.



/*
Parameters
pwszTypeName 
Points to the name of the joystick type. A buffer of MAX_JOYSTRING characters is sufficient to hold the type name. The type name should never be shown to the end user; instead, the "display name" should be shown. Use IDirectInputJoyConfig8::GetTypeInfo to obtain the display name of a joystick type. Type names that begin with a pound sign ("#") represent predefined types that cannot be modified or deleted. 

pvRef 
Points to the application-defined value given in the IDirectInputJoyConfig8::EnumTypes method.

Return value
Returns a BOOL value, DIENUM_CONTINUE, to continue the enumeration, or DIENUM_STOP to stop the enumeration. 

*/


BOOL DIEnumJoyTypeProc(
   LPCWSTR pwszTypeName,
   LPVOID  pvRef
);
 



Persyaratan

Persyaratan Nilai
Target Platform Desktop
Header dinputd.h (termasuk Dinputd.h)