Sometimes we come across ‘Subscript out of range’ error on opening the Store Operations Manager and Store Operations POS after few Installation/Uninstallation of RMS addins using some hooks for its application requirements
After installing the RMS addin which creates the hook entries in registry during installation for invoking some events in RMS system increases the hook count by 1 for each hook used.
If the hook count exceeds the count 30 then on opening the Store Operations Manager and Store Operations POS will throw the ‘Subscript out of Range’ error.
The hook count should not be above 30.
Need to keep the total hook count within the range of 30(for hooks 000 to 029).
While uninstalling the application the hook count should decrement by the number of hooks created by that addin programmatically.
[VB.Net Code snippet to handle Hook Count value]:
‘ Decrement count by 2
Dim regKey As RegistryKey = Registry.LocalMachine.OpenSubKey(“SOFTWARE\Microsoft\Retail Management System\Store Operations\Hooks”, True)
Dim strCount As String = regKey.GetValue(“Count”)
regKey.SetValue(“Count”, CStr(CInt(strCount) – 2))