Page 1 of 2
GetAppObject():exec(EXECWHILEEVENT) replacement
Posted: Sun Oct 04, 2020 1:46 pm
by rjpajaron
Hello,
I am now in the "dig deep" testing phase and some long-running process crashes and consistently trace to GetAppObject():exec(EXECWHILEEVENT). When I remove this, it went well but until it finished, the whole app is non-responsive.
I am looking for replacement code for this that in .NET way.
I am reading the X# examples and other related stuff..
TIA,
Rene
GetAppObject():exec(EXECWHILEEVENT) replacement
Posted: Sun Oct 04, 2020 2:24 pm
by wriedmann
Hi Rene,
the error don't stays in this method, and you cannot solve that in the .NET way if you are using the VO GUI classes.
This method only releases time to the OS if you have ling running processes, and an error here is caused by some other piece of code.
Wolfgang
GetAppObject():exec(EXECWHILEEVENT) replacement
Posted: Sun Oct 04, 2020 3:01 pm
by Chris
Hi Rene,
What is the error message you get when the app crashes?
And what is the app doing at that point, why did you need to have the call to Exec(EXECWHILEEVENT) in the VO code?
GetAppObject():exec(EXECWHILEEVENT) replacement
Posted: Sun Oct 04, 2020 3:05 pm
by TerryB1
Rene
It's been a long time since I looked at VO, but from memory this is what I would guess would happen if the event code was particularly long, or for some reason failed to return (release lock) on your program.
Suggest you look a little deeper into what the code is doing. A "net alternative" will go a little deeper than just a one for one swap.
If your program worked once, I suggest you get it back to working the same way before seeking out net alternatives.
Others here will be better qualified to advise.
Terry
GetAppObject():exec(EXECWHILEEVENT) replacement
Posted: Sun Oct 04, 2020 7:45 pm
by Jamal
GetAppObject():exec(EXECWHILEEVENT) replacement
Posted: Sun Oct 04, 2020 10:13 pm
by ic2
Hello Rene,
This is what I use (in C# but it won't be difficult to change it to X#) . It works well and is of course a lot easier and quicker than the more recommended way: using ASYNC calls to prevent an unresponsive UI. Although I actually do use ASYNC code in programs this turned out not to guarantee the required responsiveness while ProcessUITask, so far, always worked.
You will find the source & comments on
http://stackoverflow.com/questions/8128 ... operations
public static void ProcessUITasks()
//
// When called, forces the UI to redraw.
{
DispatcherFrame frame = new DispatcherFrame();
Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background, new DispatcherOperationCallback(delegate (object parameter) {
frame.Continue = false;
return null;
}), null);
Dispatcher.PushFrame(frame);
}
Dick
GetAppObject():exec(EXECWHILEEVENT) replacement
Posted: Sun Oct 04, 2020 11:02 pm
by rjpajaron
Hi Chris,
I wish there was a crash dump. App simply exited. I have DebugView running to see if X# go as usual other crashes I experience but this problem? No crash dump at all.
I will experiment more and also excited to get the 2.6a soon. See my reply to Wolfgang.
Here, we are seeing a code that was written (by me) for the last 20 years. When I see a EXEWHILEEVENT here and there, I do not question my "sanity" LOL why it was there. Well, VO apps works. I keep moving forward pretending that what I did yesterday is all good, until X# see my fault, ouch. Yes, 30 days with nothing but VS 2019 + X#. I am getting expertise level higher now, so I thought. I have a lot to learn when I read a lot of post here about Asynchronous programming. I got to improve this code. If it crashes, this part and others not, then, there a lot wrong on this app. I keep the positivity side that what you guys doing is all good as it speaks for itself on the X# product. Lots of wrinkle such as absence of IntelliSense and other nice things C# can do but "hey, this what VO did but much better way". and the Golden Banner of Shame as what Robert told me about when VS detected X# is slowing down. Maybe I need an 8core/32 GB memory/fastest SSD laptop.
Happy hunting....
GetAppObject():exec(EXECWHILEEVENT) replacement
Posted: Sun Oct 04, 2020 11:09 pm
by rjpajaron
Hi Terry,
Lucky you. I got stuck in VO with this huge apps (our mission critical apps). I refused to move to Vn and X# for some reason. I do not question my decision, only what I am doing today is all good. and it bite me hard. I still have VO rock solid. I will keep releasing on it for next few months or worst, years until this X# app replacement is all good as I advertise to my customers.
This app uses the same classes that other several apps are using and none of it experience any crashes at all but this. That is the clue that something wrong with architecture of this app. Good thing: I am the one who wrote it. Bad part, I have tight ship. I need to do this fast.
--
Rene
GetAppObject():exec(EXECWHILEEVENT) replacement
Posted: Sun Oct 04, 2020 11:13 pm
by rjpajaron
Hi Jamal,
I am still in VO GUI classes, hence the use of class App. Checking on X# docs, there is no DoEvents() method. Or I am missing something.
--
Rene
GetAppObject():exec(EXECWHILEEVENT) replacement
Posted: Sun Oct 04, 2020 11:17 pm
by rjpajaron
Hi Dick,
This is what I said a while back, I though I am already an expert,,,, I will try to convert this to X#. and thanks for the StackOverflow link.
One thought, I am still one-foot on the VO GUI classes in X#.
--
Rene