Please take a look at my code:
#include <windows.h>
#include <Sti.h>
#include <iostream>
#pragma comment (lib, "Sti.Lib")
using namespace std;
void main ()
{
HRESULT hr = CoInitialize(NULL);
PSTI iface = 0;
hr = StiCreateInstance(GetModuleHandle(NULL), STI_VERSION, &iface, NULL);
DWORD numDevices = 0;
STI_DEVICE_INFORMATION* devices = NULL;
hr = iface->GetDeviceList(NULL, NULL, &numDevices, (void**) &devices);
cout << hr;
hr = iface->Release();
cin.get();
}
GetDeviceList gives me “There was no match for the specified key in the index.” Any idea as to what it means? Google doesn’t seem to help here.
Everything else is OK (initialization, I mean).
Thanks in advance.
Update: It works on Win XP virtual machine, but still fails on host Win 7 x64. Odd.
STI only works on Win XP, that’s all.