Helppp Access Violation in throw stmt
-
I have an NT service program that seems to get a lot of access violations. In trying to track them down, I've found all sorts of odd things going on. Here is one of them. In this example this piece of code is called from a OnTimer callback routine. The timer was started from the COM object that the ATL wizard makes when you ask it to build a serice. e.g. Service -> IEntry.StartProcess -> SetTimer LONG OdysseyLog::GetRegStrValue(const TCHAR szSubKey[], const TCHAR szValueName[], TCHAR *pszReturnVal[], unsigned int *uiLen){ LONG lRes = ERROR_SUCCESS; DWORD dwType; DWORD dwSize; HKEY hKey; try { dwType = REG_SZ; lRes = RegOpenKeyEx( HKEY_LOCAL_MACHINE, szSubKey, 0, KEY_READ, &hKey); if (lRes != ERROR_SUCCESS) { throw true; } I get an Access Violation from the throw statement! How can that happen? The access violation is in Kernel32.dll at 0xE06D7363. running NT 4.0 with latest SPs (don't know the number, but the admin guys assure me this server is up to date). Thanks for the help, Bill