Re: Report Preview C5 Crashes

2009-01-22 Thread MB Software Solutions General Account
Cathy Pountney wrote:
 Thanks again, Cathy, for helping me think this through.


 You're welcome. Glad I could be a helpful sounding board.


Gotta love this place for that kind of thing!  ;-)




___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/3086.69.251.251.31.1232646562.squir...@webmail.dssco.net
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


RE: Report Preview C5 Crashes

2009-01-21 Thread Cathy Pountney
 Thanks again, Cathy, for helping me think this through. 


You're welcome. Glad I could be a helpful sounding board.

Cathy


___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/000f01c97bc9$38c38370$aa4a8a...@com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


RE: Report Preview C5 Crashes

2009-01-20 Thread Ken Dibble
At 12:39 PM 1/19/09 -0500, you wrote:
  For multiple reports I need the default preview toolbar to let users zoom.
  However, I have my own tricky little toolbar to let users respond to the
  preview; it has buttons to go to the next report, cancel previewing,
cancel
  printing. It's not a real toolbar, it's a modeless always-on-top form that

Why be tricky and use a modeless always-on-top form? Just use the real
toolbar and modify it to add the buttons and functionality you want. You can
use an Extension Handler to add buttons to the preview's toolbar.

Well, it got weirder before it got better. There were two separate issues.

1. I discovered that the new object-assisted report toolbar would not 
appear with the preview form for this particular report no matter what I 
did. For some reason it was created but not made visible. I had to insert 
code to hook it from _Screen.Forms and call its Show(). I still don't know 
why that happens for this report but not others.

2. The missing toolbar error was caused because my code was calling RELEASE 
WINDOW on the new preview window, which is a form, not a DEFINE WINDOW 
window. Doing that bypassed its Release() method, which contains code to 
store the toolbar state. When the preview was called for the next report in 
the set, the preview window, not having previously stored the toolbar's 
state as nonexistant, expected the toolbar to exist and tried to set its 
properties. (This seems dumb to me; if any number of errors occurs that 
causes the preview window to close unexpectedly, the resource file is going 
to get screwed up--but what do I know?)

As for using an Extension Handler to build all my stuff into the 
toolbar--that looks like a lot more work right now than I have time for. 
Maybe in a later, major new release...

Thanks again, Cathy, for helping me think this through.

Ken
www.stic-cil.org


___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/5.2.1.1.1.20090120172910.01e6e...@pop3.frontiernet.net
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


RE: Report Preview C5 Crashes

2009-01-19 Thread Cathy Pountney
You mentioned VFP 9 SP1. Have you tried this with VFP 9 SP2? Maybe the crash
is already resolved in SP2 and you're beating your head against the wall for
nothing.

I'm not sure what else to tell you. This is way too complex for me to
diagnose and fix without having a repro. I use XFRX and I do remember having
to make a few minor fixes to avoid C5 crashes with their previewer. If you
try to change the icon property on their previewer, it crashes .. so I don't
bother changing the icon. The other thing I had to do was turn off our
inherited form code that restores a window position because their previewer
crashes when the .LEFT property is touched. We can't fix it, but we can
avoid the crash by not touching the property. 

We also had trouble with their previewer not actually releasing the form if
the form is modal and the user closes the form with the toolbar Quit button.
We just had to add a RELEASE WINDOW (ThisForm.Name) to their Quit method and
all is well.

Cathy


 -Original Message-
 From: profoxtech-boun...@leafe.com [mailto:profoxtech-boun...@leafe.com]
On
 Behalf Of Ken Dibble
 Sent: Friday, January 16, 2009 12:25 PM
 To: profoxt...@leafe.com
 Subject: Report Preview C5 Crashes
 
 Hey Cathy, are you out there?
 
 I've been trying to avoid having to create my own preview window... just
 didn't want to have to put in the time when the native one is supposed to
 work.
 
 But for reasons I don't completely understand I've run into problems. I
 know to some extent this has to do with VFP's issue of getting mixed up
 between modal and modeless windows.
 
 I can't do NOWAIT for many of my previews because I have routines that
 allow users to generate multiple reports at once and preview each, going
to
 the next one by closing the preview window.
 
 In VFP 9 SP 1, I discovered that if a user had a modal (no NOWAIT) native
 VFP report preview window open in my application and clicked on the
preview
 surface, and then clicked on the main menu, they'd get a C5 crash. This
 happens in my homemade framework. The framework has a form manager that
 handles form creation commands and stores object references to forms. My
 previews are called from within forms, sometimes from a second modal form
 when two modal forms are open, sometimes from modeless forms, all of which
 are handled by the form manager. My menu has a dynamic Window pad that
 uses code I found on a newsgroup to keep a list of open windows. In short,
 I can't create a simple repro to make these crashes happen.
 
 So after trying several things, I finally settled on code to get rid of
the
 main menu while a report preview window is open.
 
 That works, but a user has just discovered that if they maximize the
 preview window under these circumstances, it takes over the whole
 application. That is, the main program window no longer seems to exist.
 There is only one title bar, and one set of min/max/close buttons, and
they
 belong to the report preview window. The application does still register
on
 the task bar, but its Close option in the pop-up menu is disabled.
 
 Once the user does this, the only way to close the preview window and
 regain access to the rest of the application is to use the close preview
 button on the preview toolbar. However, if the user has closed the preview
 toolbar, she's sunk. The only way out is to click stuff until a C5 occurs
 (or use the Task Manager to shut down the program).  One way to cause this
 crash is to click on the disabled Close option in the taskbar button's
 context menu, then click in the preview window.
 
 I understand how to use the resource file to modify the preview toolbar,
 but removing its close button isn't an option.
 
 Do you have any thoughts on how I can deal with this without having to
 create my own preview window?
 
 Thanks very much!
 
 Ken Dibble
 www.stic-cil.org
 
 
 
 
[excessive quoting removed by server]

___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/002c01c97a4b$1364d180$3a2e74...@com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


RE: Report Preview C5 Crashes

2009-01-19 Thread Ken Dibble
At 10:32 AM 1/19/2009 -0500, you wrote:
You mentioned VFP 9 SP1. Have you tried this with VFP 9 SP2? Maybe the 
crash is already resolved in SP2 and you're beating your head against the 
wall for nothing.

Thanks Cathy.

I've been reluctant to apply SP 2 because of the stuff it munges. I dimly 
recall reading that people have to pick up various pieces of hot-fixed 
stuff from various locations in order to fix the broken things. 
ReportListener source code and the help files come to mind. And haven't I 
also heard that even the most recent fixed help file still isn't as good 
as the one in SP 1? Is there a definitive comprehensive article posted 
somewhere on what to do to recover from SP 2?

Actually, after posting my question I read your articles on the new 
reporting stuff, and spent some time trying to integrate the default 
ReportListener app into my program. With not much work I was able to get 
that going for single reports--even figured out how to turn off the Print 
button in the toolbar (I use a separate .exe for printing--and I realize 
with more time I could get the Print button to call it, but was trying to 
get something done fast). This works well; I no longer have to turn off the 
menu to avoid crashes, and the preview window maximizes properly.

For multiple reports I need the default preview toolbar to let users zoom. 
However, I have my own tricky little toolbar to let users respond to the 
preview; it has buttons to go to the next report, cancel previewing, cancel 
printing. It's not a real toolbar, it's a modeless always-on-top form that 
I open before the preview window appears to make sure it's available. With 
the ReportListener app though, in this setting with my little form, for 
some reason the preview toolbar doesn't appear. The first report comes up 
fine but when the user tries to go to the next report, the ReportListener 
throws an error that it's looking for the toolbar and can't find it. Then 
the whole thing crashes.

So for right now my code sets REPORTBEHAVIOR to 80 (with my menu-killing 
dodge) for multiple reports and to 90 for single reports.

My question is, why would the preview toolbar not appear just because 
there's another form present?

Thanks again.

Ken
www.stic-cil.org


___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/5.2.1.1.1.20090119110314.01b77...@pop3.frontiernet.net
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


RE: Report Preview C5 Crashes

2009-01-19 Thread Cathy Pountney
 For multiple reports I need the default preview toolbar to let users zoom.
 However, I have my own tricky little toolbar to let users respond to the
 preview; it has buttons to go to the next report, cancel previewing,
cancel
 printing. It's not a real toolbar, it's a modeless always-on-top form that

Why be tricky and use a modeless always-on-top form? Just use the real
toolbar and modify it to add the buttons and functionality you want. You can
use an Extension Handler to add buttons to the preview's toolbar. 

Cathy



___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/003d01c97a5c$f1af30a0$d50d91...@com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


RE: Report Preview C5 Crashes

2009-01-19 Thread Ken Dibble
At 12:39 PM 1/19/2009 -0500, you wrote:
  For multiple reports I need the default preview toolbar to let users zoom.
  However, I have my own tricky little toolbar to let users respond to the
  preview; it has buttons to go to the next report, cancel previewing,
cancel
  printing. It's not a real toolbar, it's a modeless always-on-top form that

Why be tricky and use a modeless always-on-top form? Just use the real
toolbar and modify it to add the buttons and functionality you want. You can
use an Extension Handler to add buttons to the preview's toolbar.

Right. I was trying to save time, but I guess I'll investigate that.

Thanks.

Ken
www.stic-cil.org 


___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/5.2.1.1.1.20090119131439.01bb3...@pop3.frontiernet.net
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


Re: Report Preview C5 Crashes

2009-01-16 Thread MB Software Solutions General Account
On Fri, January 16, 2009 12:24 pm, Ken Dibble wrote:
 Hey Cathy, are you out there?


 I've been trying to avoid having to create my own preview window... just
 didn't want to have to put in the time when the native one is supposed to
 work.


So don't roll your own...use someone else's  Here's the code I've got
in my main.prg which gets called from various areas in the exe:

FUNCTION ShowReport(tcRpt as String, tcCaption as String)
* mjb 01-24-05 using Fred Taylor's idea for showing report inside max
window (courtesy ProFox archives)
LOCAL loFrm
loFrm = CREATEOBJECT(Form)

WITH loFrm
.Caption = tcCaption
.WindowState = 2  Maximized
.Show()
REPORT FORM (tcRpt) TO PRINTER PROMPT NOCONSOLE PREVIEW WINDOW 
(.Name)
.Release()
ENDWITH  loFrm
ENDFUNC  ShowReport(tcRpt as String, tcCaption as String)


That's an older version.  I've updated it somewhat (but don't have that
source at hand right now) where I pass the cursor name, whether to close
it after running the report, etc.




___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/41573.69.7.77.20.1232131074.squir...@webmail.dssco.net
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


RE: Report Preview C5 Crashes

2009-01-16 Thread Tracy Pearson
There are two things about that code I would consider changing.
Since there have been reported problems of returning from a method in a
WITH/ENDWITH, I don't like the .Release(). It may result in a similar C5 as
returning from the WITH/ENDWITH scenario does. Move it outside with
oForm.Release()


The other issue is a grey window behind the report preview window.
You could replace
.WindowState = 2
.Show()
With
ZOOM WINDOW (.Name) MAX


Tracy

-Original Message-
From: MB Software Solutions General Account
Sent: Friday, January 16, 2009 1:38 PM

On Fri, January 16, 2009 12:24 pm, Ken Dibble wrote:
 Hey Cathy, are you out there?


 I've been trying to avoid having to create my own preview window... 
 just didn't want to have to put in the time when the native one is 
 supposed to work.


So don't roll your own...use someone else's  Here's the code I've got in
my main.prg which gets called from various areas in the exe:

FUNCTION ShowReport(tcRpt as String, tcCaption as String)
* mjb 01-24-05 using Fred Taylor's idea for showing report inside max window
(courtesy ProFox archives)
LOCAL loFrm
loFrm = CREATEOBJECT(Form)

WITH loFrm
.Caption = tcCaption
.WindowState = 2  Maximized
.Show()
REPORT FORM (tcRpt) TO PRINTER PROMPT NOCONSOLE PREVIEW
WINDOW (.Name)
.Release()
ENDWITH  loFrm
ENDFUNC  ShowReport(tcRpt as String, tcCaption as String)


That's an older version.  I've updated it somewhat (but don't have that
source at hand right now) where I pass the cursor name, whether to close it
after running the report, etc.




___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/000701c9780a$8e33df20$aa9b9d...@com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


RE: Report Preview C5 Crashes

2009-01-16 Thread MB Software Solutions General Account
On Fri, January 16, 2009 1:45 pm, Tracy Pearson wrote:
 There are two things about that code I would consider changing.
 Since there have been reported problems of returning from a method in a
 WITH/ENDWITH, I don't like the .Release(). It may result in a similar C5
 as returning from the WITH/ENDWITH scenario does. Move it outside with
 oForm.Release()


 The other issue is a grey window behind the report preview window.
 You could replace
 .WindowState = 2
 .Show()
 With
 ZOOM WINDOW (.Name) MAX


Hi Tracy,

I had tried the ZOOM WINDOW way back when and for whatever reason it
didn't work as I expected, so I went back to using WindowState.  Not sure
about the specifics, but I know that this worked for me, and, no C5s.  So,
your comments are good ones and others should take heed.  I'll probably
refactor it someday given these comments!  ;-)

Thanks!
--Michael




___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/22709.69.7.77.20.1232138538.squir...@webmail.dssco.net
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


RE: Report Preview C5 Crashes

2009-01-16 Thread Tracy Pearson
The ZOOM WINDOW problem is due to the application being in a Top Level form
and SCREEN=OFF configuration. 

Use a custom form class with ShowWindow = 1 instead of the base form class.


-Original Message-
From: MB Software Solutions General Account
Sent: Friday, January 16, 2009 3:42 PM

On Fri, January 16, 2009 1:45 pm, Tracy Pearson wrote:
 There are two things about that code I would consider changing.
 Since there have been reported problems of returning from a method in 
 a WITH/ENDWITH, I don't like the .Release(). It may result in a 
 similar C5 as returning from the WITH/ENDWITH scenario does. Move it 
 outside with
 oForm.Release()


 The other issue is a grey window behind the report preview window.
 You could replace
 .WindowState = 2
 .Show()
 With
 ZOOM WINDOW (.Name) MAX


Hi Tracy,

I had tried the ZOOM WINDOW way back when and for whatever reason it didn't
work as I expected, so I went back to using WindowState.  Not sure about the
specifics, but I know that this worked for me, and, no C5s.  So, your
comments are good ones and others should take heed.  I'll probably refactor
it someday given these comments!  ;-)

Thanks!
--Michael



___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/000801c97818$cec5d670$6c5183...@com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.