Click here to Skip to main content
15,885,365 members

Error C# 'system.stackoverflowexception'

Preatorian (RightCom) asked:

Open original thread
I have an  error "System.StackOverflowException"
 when I get all alarms from cameras devices, any help ??


What I have tried:

switch (_iAlarmType)
            {
                case AlarmConstMsgType.ALARM_VCA_INFO:

                    sbAlarmMsg.Append("- VCA");
                    int iChannelNumber = 0;
                    int iretu = NVSSDK.NetClient_GetChannelNum(_ulLogonID, ref iChannelNumber);
                    int channelCamera = iChannelNumber;
                    int int_rule = 0;
                    int iBufSiz = 80;
                    m_lpbuf = new NVS_FILE_LPBUF();

                    int iRetx = NVSSDK.NetClient_VCAGetAlarmInfo(_ulLogonID, _iAlarmState, ref m_lpbuf, iBufSiz);

                  try {
                        Console.WriteLine("Loading received alerts : " + m_lpbuf.m_iRuleID , "MyAlarm_NOTIFY_V4" + " " + DateTime.Today.ToString());
                        ObjLog.LoggerWritter("Loading received alerts : " + m_lpbuf.m_iRuleID + "  MyAlarm_NOTIFY_V4" + " " + DateTime.Today.ToString());
                        ObjLog.LoggerWritter("Loading  Alerts Rules : {" + m_lpbuf.m_iRuleID + "} MyAlarm_NOTIFY_V4" + " " + str_VCARules.ToString());

 
                        int  AlarmSentChannel = channelCamera;
                        int AlarmSentCustCompanyID = CustomerID;
                        string  AlarmSentDateIng = Convert.ToString(DateTime.Today);
                        string AlarmSentDescription = GetiAlarmType(_iAlarmType) + " - " + sbAlarmMsg.ToString();
                        int AlarmSentEstado = _iAlarmState;
                        string AlarmSentIDE = Convert.ToString(m_lpbuf.m_iID);// IPCustomer; // cantidadtrips++;
                        string AlarmSentrctTarget = "";
                        string AlarmSentRuleDescrip = GetiAlarmType(_iAlarmType) + " - " +  sbAlarmMsg.ToString();
                        int AlarmSentRuleID =  m_lpbuf.m_iRuleID; 
                        int AlarmSentState = _iAlarmState;
                        int AlarmSentTargetDirection = 0;
                        int AlarmSentTargetID = Convert.ToInt32(_iAlarmState.ToString());
                        int AlarmSentTargetSpeed = 0;
                        int AlarmSentTargetType = _iAlarmType;
                        int AlarmSentventType = _iAlarmType;

                        try
                        {
                            
                            string needle = _ulLogonID.ToString();
                            foreach (Device foo in Lista)
                            {
                                if (foo.DeviceIDLogon == needle)
                                {
                                    AlarmSentIDE = foo.DeviceIP;
                                }
                            }
                        }catch (Exception ex){

                        }

                        
                        SendAlarmsToNextivaSWG( AlarmSentChannel,
                                                AlarmSentCustCompanyID,
                                                AlarmSentDateIng,
                                                AlarmSentDescription,
                                                AlarmSentEstado,
                                                AlarmSentIDE,
                                                AlarmSentrctTarget,
                                                AlarmSentRuleDescrip,
                                                AlarmSentRuleID,
                                                AlarmSentState,
                                                AlarmSentTargetDirection,
                                                AlarmSentTargetID,
                                                AlarmSentTargetSpeed,
                                                AlarmSentTargetType,
                                                AlarmSentventType);

                        ObjLog.LoggerWritter("Sending received alerts to WebService Server from Device : " + AlarmSentIDE);

                   } catch (Exception ex) {
                            Console.WriteLine("Error Remote Windows Service SWG : {0} ", "MyAlarm_NOTIFY_V4" + " " + DateTime.Today.ToString());
                   }

                    return;
                  
                    break;
                default:
                    sbAlarmMsg.Append("-" + _iAlarmType.ToString());
                    break;
            }
Tags: C#, .NET, SDK

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900