Bonjour,

dans une application Windows Win32 j'essaie de trouver mon lecteur d'empreinte digitale :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Définir manuellement le type de capteur d'empreintes digitales
const SENSOR_TYPE_ID SENSOR_TYPE_FINGERPRINT = { 0xCA7C0B7E, 0xD1A1, 0x4D9B, { 0xA3, 0xB9, 0xA4, 0x1E, 0x6E, 0xB1, 0x80, 0xB2 } };
 
HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
if (FAILED(hr)) {
	OutputDebugStringA("Failed to initialize COM library.");
	return;
}
 
ISensorManager* pSensorManager = nullptr;
hr = CoCreateInstance(CLSID_SensorManager, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pSensorManager));
if (FAILED(hr)) {
	OutputDebugStringA("Failed to create sensor manager.");
	CoUninitialize();
	return;
}
 
ISensorCollection* pSensorCollection = nullptr;
hr = pSensorManager->GetSensorsByType(SENSOR_TYPE_FINGERPRINT, &pSensorCollection);
if (FAILED(hr) || pSensorCollection == nullptr) {
	OutputDebugStringA("Failed to get sensors by type.");
	pSensorManager->Release();
	CoUninitialize();
	return;
}
mais ce code me retourne :
Failed to get sensors by type.
Merci