I need to determine which COM port Irda is bound to at run-time. I found the following piece of code:
(http://www.codeproject.com/ce/TVRemote.asp)
However there is no such registry entry on my a716. There is a HKEY_LOCAL_MACHINE\Comm\IrDA key, but it does not contain a Port value.
Any suggestions?
Dan East
- Code:
// Look into the registry for the IR port number
HKEY hKey = NULL;
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Comm\\IrDA"),
0, 0, &hKey;) == ERROR_SUCCESS)
{
DWORD dwType = 0;
DWORD dwData = 0;
DWORD dwSize = sizeof(dwData);
if (RegQueryValueEx(hKey, _T("Port"), NULL, &dwType;,
(LPBYTE) &dwData;, &dwSize;) == ERROR_SUCCESS)
{
if (dwType == REG_DWORD && dwSize == sizeof(dwData))
{
RegCloseKey(hKey);
return (UINT) dwData;
}
}
RegCloseKey(hKey);
}
return 0;
(http://www.codeproject.com/ce/TVRemote.asp)
However there is no such registry entry on my a716. There is a HKEY_LOCAL_MACHINE\Comm\IrDA key, but it does not contain a Port value.
Any suggestions?
Dan East