native exception with try-catch

M

matvdl

I have developed an application in VB.net and recently have started to get
native exceptions. When running the application on the device I get an error
that says "A native exception has occured in ....." and it gives me two
buttons - details or quit.

When viewing details it gives me:

Error
ExceptionCode: 0xc0000005
ExceptionAddress: 0x006c0044
Reading: 0x006c0044

at NativeMethods.OpenStore(IntPtr pOpenInfo, IntPtr pfnOnFlushFailure,
IntPtr& pStoreService, IntPtr& pStoreServer, IntPtr& pQpServices, IntPtr&
pSeStore, IntPtr& pTx, IntPtr& pQpDatabase, IntPtr& pQpSession, IntPtr&
pStoreEvents, IntPtr& pError)
at SqlCeConnection.Open(Boolean silent)
at rmcRemoteConnection.get_LocalConnection()
at rmcRemoteConnection.ExecuteCommand(String SQLStr, SqlCeCommand Command)
at rmcRemoteConnection.ExecuteCommand(SqlCeCommand Command)
at kWGlobal.ExecuteCommand(SqlCeCommand cmd)
at ComponentGlobal.SendDataTokWatch()
at ComponentGlobal.IntervalTime(Object state)
at Timer.ring()

The code within ComponentGlobal.IntervalTime is:

Private Shared Sub IntervalTime(ByVal state As Object)
'THis is fired whenever the time is passed
Dim DatS As datDataSource
Dim BaseTime As New Date(2000, 1, 1)

Try
For Each DatS In DataSources


If (NextIntervalDueDate.Subtract(BaseTime).TotalMilliseconds
Mod DatS.Interval) = 0 Then
'THis means the correct number of intervals has passed
DatS.IntervalTime(Nothing)
End If

Next

'Set the next timeout period
SetNextEvent()

SendDataTokWatch()
Catch ex As Exception
End Try

End Sub

As you can see the entire function is within a try-catch but the error is
not caught. This is a major issue as the reliability of the application is
crucial.

If anyone can help it would be much appreciated.
 
D

dbgrick

You might be able to gather additional information by wiring up the
UnhandledException manager in your Main method. Before your Application.Run
methid, wire up the exception using the
AppDomain.CurrentDomain.UnhandledException event handler. Then you can try
to gather additional info through the UnhandledExceptionEventArgs stack trace
or inner exception attribute.

I hope this helps you.
Regards,
Rick D.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top