This trick from Chris Pollach @Appeon is FANTASTIC!!
add a pb.ini to the folder of your executable
PB.ini
------------------
[DataStore Behavior]
UseHwnd=no
----------------------
This trick from Chris Pollach @Appeon is FANTASTIC!!
add a pb.ini to the folder of your executable
PB.ini
------------------
[DataStore Behavior]
UseHwnd=no
----------------------
Hi,
just an update on this.
EVERYTHING is working PERFECT .. no side effect. I just thing this is wonderful - it made a world of difference for stability when using many large batchjobs in separate instances of the same PB app. :-)
//Steen
I've found a side effect after all:
when UseHwnd=no is set, using Print(true,true) on a datastore (or the pfc_print event, which also does Print(true,true)) will not show the printer selection box and instead shows the print dialog for the current default printer. Now the help does state "When working with DataStores, the showprintdialog argument must always be set to false." So I guess UseHwnd=yes enables a datastore to be printed like a datawindow.
FWIW,
Interesting, when I use the 'correct' order of first doing a Reset() and then assigning the dataobject = "", it blows up in of_update_totals(), when exiting the app. I'm not using yield(). Here's the stack:
With the 'incorrect' order of doing first dataobject = "" and then the reset(), my stack looks like this and doesn't blow up, but the fact it's still passing through the function while the application seems to have been closed already, is a bit concerning: no local, instance or global variables, nothing shown on the stack, no way to inspect anything with QuickView. The app has obviously stopped already, but it still looks like I'm passing through this function:
Probably something we do wrong somewhere.
regards,
MiguelL
Hi Chris and Steen,
In the past, I followed Chris' advice on doing:
and that has been working great since July last year. But now Chris recommends something a little bit different, so I said let's try this:
All kind of weird things started to happen. I was getting blowups while running the application due to datawindows not having any rows, whereas before, they always had at least one row. It took me a while to remember this last change I did last Friday (weekend does a g_miguel.reset() ), and I undid the change: All problems went away.
So using the yield(), the execution order of events must have changed in some places in my code.
I'm not saying to not do the yield(), but just want to point out to test you code again after you do so. In my case there's too much bad coding going on, so I cannot use the yield().
Not too sure if it's the same doing things in this order:
or doing it in this order:
I think the last order would make more sense, so I'm going to try that out and will post if I have any problems.
Regards
MiguelL
A follow-on question for Chris or anyone else from Appeon:
What internal behavior does this pb.ini setting change (i.e., what does it do)? I'm happy for Steen and others who use this with no apparent side effects, but I would not conclude that there are no side effects just because I have not become aware of any side effects.
FWIW, I agree with Benjamin. Why isn't the disabling of this "feature" the standard, if it truly is harmless? Shouldn't the default setting or condition of PB be to keep applications from crashing randomly?
Hi Steen ... you are most welcome - this is "awesome" news! Have you hugged a DataWindow today? ;-)
Also everyone, here is what you should add to your DW Control and DS's on the Destructor event (hopefully you have one ancestor each of these classes) to help with the proper releasing of memory and GDI resources as well ...
I have been using this logic in my STD frameworks for EONS (App"eons" that is). A tip that I got from the PowerSoft engineers many moons ago! :-)
PowerOn!
Regards ... Chris
No downsides at all? Why is this neither documented nor switched off by default?
I have done that for a while (2 months) now and it fixes ALL RANDOM CRASH happening.
And there are zero side effects.
I'm just so happy I cannot express. The random crashes constantly happened and we have been chasing our own code for moths. The "USER OBJECTS" in the windows task manager went from several hundreds to just 4 and now everything works perfect and maybe a bit faster.
*** THANK YOU Chris for this tip :-) ***
Everyone should know!!
//Steen