943,608 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Marked Solved
  • Views: 487
  • C# RSS
Apr 20th, 2009
0

execution comes from catch to try

Expand Post »
i have the following code :

C# Syntax (Toggle Plain Text)
  1. static IScanningService scanningLayer = null;
  2. public static IScanningService BarcodeReader
  3. {
  4. get
  5. {
  6. if (scanningLayer == null)
  7. {
  8. string serviceName = GetServiceName();
  9. try
  10. {
  11. if (deviceService == null)
  12. deviceService = Assembly.Load(serviceName);
  13. object o = deviceService.CreateInstance(serviceName + ".BarcodeReader");
  14. scanningLayer = o as IScanningService;
  15. scanningLayer.AutoStartScan = Global.device.AutoStartScan;
  16. scanningLayer.PauseTime = Global.device.PauseTime;
  17. scanningLayer.ScanTime = Global.device.ScanTime;
  18. }
  19. catch (Exception ex)
  20. {
  21. if (ex.InnerException == null)
  22. {
  23. ErrorForm err = new ErrorForm();
  24. err.ShowDialog();
  25. //MessageBox.Show(ex.Message);
  26.  
  27. //throw new ApplicationException(
  28. // string.Format(Properties.Resources.FailedToLoad, serviceName), ex);
  29. }
  30. //throw ex;
  31. }
  32. }
  33. return scanningLayer;
  34. }
  35. }
for the first time in my life i see that after executing catch it comes back to try and starts infinite loop. Any explanation?
Featured Poster
Reputation Points: 854
Solved Threads: 127
Banned
serkan sendur is offline Offline
2,057 posts
since Jan 2008
Apr 20th, 2009
0

Re: execution comes from catch to try

Strange!! Did you debug it?
Featured Poster
Reputation Points: 480
Solved Threads: 276
Postaholic
Ramy Mahrous is offline Offline
2,189 posts
since Aug 2006
Apr 21st, 2009
0

Re: execution comes from catch to try

Strange!! Did you debug it?
yeah that was when i noticed the problem.
Featured Poster
Reputation Points: 854
Solved Threads: 127
Banned
serkan sendur is offline Offline
2,057 posts
since Jan 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: Publish in C# Express
Next Thread in C# Forum Timeline: Using an HWnd





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC