Ah I got it to work! Thanks for the help. I found out my error was coming from my own method of opening a handle. I have an older version of the "phidgets21.dll" and for some reason there is a linking error when I'm trying to use the API calls.
In order to work around this error, I had to manually load the library and use this code:
Code:
bool InterfaceKit::load_Pointers()
{
HMODULE m_hModule = LoadLibrary(_T("phidget21.dll"));
if (m_hModule != 0)
{
// Get Touch Sensor API entry points
m_iPhidgets.create = (PhidgetInterfaceKit_create)::GetProcAddress(m_hModule, _T("CPhidgetInterfaceKit_create"));
m_iPhidgets.open = (Phidget_open)::GetProcAddress(m_hModule, _T("CPhidget_open"));
m_iPhidgets.waitForAttachment = (Phidget_waitForAttachment)::GetProcAddress(m_hModule, _T("CPhidget_waitForAttachment"));
m_iPhidgets.close = (Phidget_close)::GetProcAddress(m_hModule, _T("CPhidget_close"));
m_iPhidgets.destroy = (Phidget_delete)::GetProcAddress(m_hModule, _T("CPhidget_delete"));
m_iPhidgets.getSensorValue = (PhidgetInterfaceKit_getSensorValue)::GetProcAddress(m_hModule, _T("CPhidgetInterfaceKit_getSensorValue"));
return true;
}
return false;
}
//create and open the Phidget
bool InterfaceKit::start () {
if(!load_Pointers())
return false;
m_iPhidgets.create(&m_hInterfaceKit);
m_iPhidgets.open((CPhidgetHandle)m_hInterfaceKit, 55325);
if (m_iPhidgets.waitForAttachment((CPhidgetHandle)m_hInterfaceKit, 10000))
return false;
return true;
}
Have you ever encountered a linking error? In addition, do you think that a newer version of the dll would fix this problem?
Thanks