whats replace of ThreadAbortException for winRT - windows-8

I am converting .Net code to winRT. I searched but did not find replace of ThreadAbortException that I may write for winRT. Please tell me about this or about some general thread exception.
Thanks

There is no thread abort in winRT. so, you don't need to handle this.

Probably the most similar error you can use is OperationCanceledException. This error is thrown by WinRT asynchronous operations when they are aborted and it is supported in all WinRT projections. For more information, take a look at http://msdn.microsoft.com/en-in/library/windows/apps/hh699896.aspx

Related

How to detect uncaught exceptions in VB.Net (static code analysis)?

I'm developping a winform application and I would like to make it as robust as possible.
In my code there are classes where I throw exceptions that I master very well and catch them whenever it's needed. However, there are some other classes/methods that throw exception that I may have forgotten and are not thrown in the current testing scenarios.
Let's say for example the class StreamReader The constructor may throw different exceptions that should be handeled (MSDN)
My question is there any tool for VB.Net (which works) that would check if am I instanciating the class StreamReader in a Try and Catch ?
I have been looking to the page : Wiki
I checked also the threads StackOverFlow and StackOverFlow
But none of them really helped me.
I read somewhere that every operation theoretically can throw an exception. Well, the idea is to reduce at least the "first level" exception and at least only for core .Net components that may have been forgotten without necessarily targetting 100% of the exceptions or targetting third parties classes.
If someone has an answer I would appreciate your help :)
Cheers in advance.

Windows 8 Metro/Immersive App - Force Terminate

I'm working on porting an app from iOS to WinRT/8 Metro/8 Immersive/Whatever the current name is.
On iOS, we have the ability to set Application does not run in background to YES to cause the app to actually quit whenever the user leaves the app.
I would like to figure out how to replicate this behavior in WinRT.
Yes, I understand that this is abnormal behavior.
Yes, I have thought this through.
Yes, I have an extremely good reason for doing this.
I'm assuming that during the userLeavingApp event, I would just call Application.Current.Exit(), but I can't seem to find the userLeavingApp event. I thought about using OnSuspending (Handles Me.Suspending) in App.xaml.vb, but that doesn't seem to be called quickly enough for me.
Is there a .NET equivalent of viewWillDisappear or something?
Any ideas? This is an important security characteristic of my app, and I'd hate to have such difficulty in an entire platform due to such a small issue.
Thanks!
I'm not actually seeing Application.Current.Exit() working in OnSuspending; although as you mention the suspending isn't happening fast enough for you (which is by design). Throwing an exception there didn't work for me either.
There is Window.VisibilityChanged and if I issue Exit/exception there, it does shutdown the app when another app takes over. That said, VisibilityChanged will fire under other circumstances too so not sure if you could cover all the scenarios or rely on them not changing. See here for a bit more context.
To echo #Filip, whose response just popped in, it's highly unlikely you'll pass certification. An Exit() call is tantamount to an exception.
I don't think your app will pass certification if you call Application.Current.Exit(). If you are really confident this is what you want - I guess it is worth a shot to try. You could though simply unload anything that uses memory/CPU when you exit.

.net Compact Framework callstack - how?

The System.Diagnostics namespace (and GetFrame(int frameNumber) in particular) is not available in the CF. How do I go about getting callstack details when running on CE (6.0 R3) ?
Thanks!
If you throw an exception you can then look at the callstack in the exception by parsing the callstack string. There really aren't any cleaner alternatives.

Need Method Entry and Exit event in .net

I like to have event like OnMethodEntry and OnMethodExit which will be used to raise an event when a method in a class is getting invoked in C#.NET.
I have seen Post Sharp which give this feature. Since it is third party tool, we like to design a library something similar to that.
How can I do that?
Thanks,
P.Gopalakrishnan.
CodeProject has a nice article that I think will meet your needs: MethodLogger - Hook into method calls in .NET binaries.
One way to do this is to modify assemblies by inserting these method calls manually in the IL.
You may try Cecil or CCI. They are good and mature libraries for reading and patching assemblies.

Is there a method for handling errors from COM objects in RDML?

Is there a method for handling errors from COM objects in RDML? For instance, when calling Word VBA methods like PasteSpecial, an error is returned and the LANSA application crashes. I cannot find anything in the documentation to allow handling of these errors.
Actually, error handling in general is a weak-point for LANSA and RDML, but that's another topic.
I know almost nothing about LANSA etc. A few minutes in Google convinced me that error handling is, as you say, not a strong point. Over on the lansa.us site there is this article about remote debugging which, at a stretch, might be going in the right direction.
One wonders if a DEF_BREAK would work. Here's a longish post about using DEF_BREAK. If DEF_BREAK hooks in with #COM_* functions, that might be a possibility. Please pardon my naivety in this regard.
I also found some code at the LANSA Tech Exchange. I had hoped that there'd be something obvious, but no. Being more LANSA-aware than me, you may find something.
At my company, we were able to handle Communication API's through the ActiveX part of LANSA. The supplier embedded his API's in an ActiveX component. We used this component in our LANSA application. This works fine and stable.
Maybe you could embed the Microsoft API's in an ActiveX component too? I don't know from the top of my head if Microsoft Word can be addressed as an ActiveX component.