Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #5855 > unrolled thread

ShellExecute fails to open document 1st time in Word 2010

Started byD.J.W. van Kooten <public@ic2remove.this.com>
First post2013-09-20 21:06 +0200
Last post2013-10-15 20:41 -0400
Articles 8 — 4 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  ShellExecute fails to open document 1st time in Word 2010 D.J.W. van Kooten <public@ic2remove.this.com> - 2013-09-20 21:06 +0200
    Re: ShellExecute fails to open document 1st time in Word 2010 "Jamal" <jamal@examples.net> - 2013-09-21 13:42 -0400
      Re: ShellExecute fails to open document 1st time in Word 2010 D.J.W. van Kooten <public@ic2remove.this.com> - 2013-09-23 11:25 +0200
    Re: ShellExecute fails to open document 1st time in Word 2010 Malcolm G <malcolm-news2012delete@delete.jobstream.com> - 2013-09-23 11:04 +0100
      Re: ShellExecute fails to open document 1st time in Word 2010 D.J.W. van Kooten <public@ic2remove.this.com> - 2013-09-23 13:21 +0200
        Re: ShellExecute fails to open document 1st time in Word 2010 D.J.W. van Kooten <public@ic2remove.this.com> - 2013-10-15 20:13 +0200
          Re: ShellExecute fails to open document 1st time in Word 2010 Massimo Bighelli <info@arcasistemi.it> - 2013-10-16 01:05 +0200
          Re: ShellExecute fails to open document 1st time in Word 2010 "Jamal" <jamal@examples.net> - 2013-10-15 20:41 -0400

#5855 — ShellExecute fails to open document 1st time in Word 2010

FromD.J.W. van Kooten <public@ic2remove.this.com>
Date2013-09-20 21:06 +0200
SubjectShellExecute fails to open document 1st time in Word 2010
Message-ID<2k6p39peneka4t3uao457snlm3q7i9dgta@4ax.com>
This is again one of those weird problems. We open documents on a
doubleclick from a bBrowser in > 1 control depending on the document. 
Now one user showed me that the first time he opens a Word document
(using ShellExecute) Word 2010 opens but without a document. Next try
works, keeping Word open helps. The preview shows and a doubleclick on
the OleAutoobject - which we use for the preview - always opens the
document, and much faster as via the ShellExecute as in that case Word
2010 takes >10 seconds "validating".

The weird thing in this is that the code to open has remained
unchanged for ages but when I run my previous program version of 2
months back on the very same PC and data, the problem doesn't occur! I
really see no relevant changes, code is the standard:

ShellExecute(NULL,String2Psz("open"),String2Psz(cFile),NULL,
NULL,SW_SHOWNORMAL)

Also, the problem doesn't occur here on my Word 2003 version.

Would there be any way I can mimick the doubleclick on the
oleautoobject somehow (as this always opens the document and -also in
the previous version- much faster)?

Or does anyone has an idea what could cause this change in behaviour
without an obvious code change?

Dick

[toc] | [next] | [standalone]


#5857

From"Jamal" <jamal@examples.net>
Date2013-09-21 13:42 -0400
Message-ID<l1klpu$rka$1@speranza.aioe.org>
In reply to#5855
Ask the user to repair MS office and see what happens. It could be a 
corrupted registry key.

Jamal

"D.J.W. van Kooten"  wrote in message 
news:2k6p39peneka4t3uao457snlm3q7i9dgta@4ax.com...

This is again one of those weird problems. We open documents on a
doubleclick from a bBrowser in > 1 control depending on the document.
Now one user showed me that the first time he opens a Word document
(using ShellExecute) Word 2010 opens but without a document. Next try
works, keeping Word open helps. The preview shows and a doubleclick on
the OleAutoobject - which we use for the preview - always opens the
document, and much faster as via the ShellExecute as in that case Word
2010 takes >10 seconds "validating".

The weird thing in this is that the code to open has remained
unchanged for ages but when I run my previous program version of 2
months back on the very same PC and data, the problem doesn't occur! I
really see no relevant changes, code is the standard:

ShellExecute(NULL,String2Psz("open"),String2Psz(cFile),NULL,
NULL,SW_SHOWNORMAL)

Also, the problem doesn't occur here on my Word 2003 version.

Would there be any way I can mimick the doubleclick on the
oleautoobject somehow (as this always opens the document and -also in
the previous version- much faster)?

Or does anyone has an idea what could cause this change in behaviour
without an obvious code change?

Dick 

[toc] | [prev] | [next] | [standalone]


#5859

FromD.J.W. van Kooten <public@ic2remove.this.com>
Date2013-09-23 11:25 +0200
Message-ID<d52049louigd75ifgvdlsetpu91560geu9@4ax.com>
In reply to#5857
On Sat, 21 Sep 2013 13:42:24 -0400, "Jamal" <jamal@examples.net>
wrote:

Hello Jamal,

>Ask the user to repair MS office and see what happens. It could be a 
>corrupted registry key.
>

I don't think that is the case as it works fine with my previous
program version. Luckily, I just found out that my employee has the
same Word version and the same problem, so hopefully he can see what
is different in the previous version and solve it.

Dick

[toc] | [prev] | [next] | [standalone]


#5860

FromMalcolm G <malcolm-news2012delete@delete.jobstream.com>
Date2013-09-23 11:04 +0100
Message-ID<xmU%t.105417$dY5.97432@fx07.am4>
In reply to#5855
> ShellExecute(NULL,String2Psz("open"),String2Psz(cFile),NULL,
> NULL,SW_SHOWNORMAL)

I assume
1) you are using the open verb in both cases?
2) you have not redefined ShellExecute between the versions
?

[toc] | [prev] | [next] | [standalone]


#5861

FromD.J.W. van Kooten <public@ic2remove.this.com>
Date2013-09-23 13:21 +0200
Message-ID<au80491pk4rqmqad9cv5i3bcl1u0mbj22u@4ax.com>
In reply to#5860
On Mon, 23 Sep 2013 11:04:13 +0100, Malcolm G
<malcolm-news2012delete@delete.jobstream.com> wrote:

Hello Malcolm,

>I assume
>1) you are using the open verb in both cases?
>2) you have not redefined ShellExecute between the versions
>?

As far as I could see, I haven't changed anything. But I must have
overlooked something as it works in a version of 2 months ago. I hope
my employee can find that I overlooked as it doesn't work for him
either.

I'll let you know!

Dick

[toc] | [prev] | [next] | [standalone]


#6099

FromD.J.W. van Kooten <public@ic2remove.this.com>
Date2013-10-15 20:13 +0200
Message-ID<v31r595io02hjhrs3rv7qco8i6qr95u19r@4ax.com>
In reply to#5861
On Mon, 23 Sep 2013 13:21:21 +0200, D.J.W. van Kooten
<public@ic2remove.this.com> wrote:

Hello all,

>I'll let you know!
>
The problems is solved, by a complete rewite done by Kees after a lot
of investigations:

lpShellInfo.cbSize := _SIZEOF (_winSHELLEXECUTEINFO)
lpShellInfo.hwnd := SELF:oCaller:Handle()
lpShellInfo.lpVerb := String2Psz("open")
lpShellInfo.lpFile := String2Psz(cFile)
lpShellInfo.nShow := SW_SHOWNORMAL
lpShellInfo.fMask := SEE_MASK_WAITFORINPUTIDLE 
			
IF ShellExecuteEx (@lpShellInfo)
	hProc := lpShellInfo.hProcess
ENDIF

instead of ShellExecute.

I already noted that on my system, with Word 2003, it worked fine. Our
change was that we displayed a preview while browsing through
documents. Word versions after 2003 are many times slower than 2003
and apparently fail to load in time, after which also the doubleclick
-which wasn't changed at all- fails.

The above code, especially the SEE_MASK_WAITFORINPUTIDLE, solves this
problem.

Dick

[toc] | [prev] | [next] | [standalone]


#6100

FromMassimo Bighelli <info@arcasistemi.it>
Date2013-10-16 01:05 +0200
Message-ID<l3khn0$o5b$1@speranza.aioe.org>
In reply to#6099
WOW !

Good to know

thx

*Massimo Bighelli* ARCA Sistemi S.r.l.


Il 15/10/2013 20:13, D.J.W. van Kooten ha scritto:
> On Mon, 23 Sep 2013 13:21:21 +0200, D.J.W. van Kooten
> <public@ic2remove.this.com> wrote:
>
> Hello all,
>
>> I'll let you know!
>>
> The problems is solved, by a complete rewite done by Kees after a lot
> of investigations:
>
> lpShellInfo.cbSize := _SIZEOF (_winSHELLEXECUTEINFO)
> lpShellInfo.hwnd := SELF:oCaller:Handle()
> lpShellInfo.lpVerb := String2Psz("open")
> lpShellInfo.lpFile := String2Psz(cFile)
> lpShellInfo.nShow := SW_SHOWNORMAL
> lpShellInfo.fMask := SEE_MASK_WAITFORINPUTIDLE
> 			
> IF ShellExecuteEx (@lpShellInfo)
> 	hProc := lpShellInfo.hProcess
> ENDIF
>
> instead of ShellExecute.
>
> I already noted that on my system, with Word 2003, it worked fine. Our
> change was that we displayed a preview while browsing through
> documents. Word versions after 2003 are many times slower than 2003
> and apparently fail to load in time, after which also the doubleclick
> -which wasn't changed at all- fails.
>
> The above code, especially the SEE_MASK_WAITFORINPUTIDLE, solves this
> problem.
>
> Dick
>


[toc] | [prev] | [next] | [standalone]


#6101

From"Jamal" <jamal@examples.net>
Date2013-10-15 20:41 -0400
Message-ID<l3knbe$3nd$1@speranza.aioe.org>
In reply to#6099
That's a good find!

"D.J.W. van Kooten"  wrote in message 
news:v31r595io02hjhrs3rv7qco8i6qr95u19r@4ax.com...

On Mon, 23 Sep 2013 13:21:21 +0200, D.J.W. van Kooten
<public@ic2remove.this.com> wrote:

Hello all,

>I'll let you know!
>
The problems is solved, by a complete rewite done by Kees after a lot
of investigations:

lpShellInfo.cbSize := _SIZEOF (_winSHELLEXECUTEINFO)
lpShellInfo.hwnd := SELF:oCaller:Handle()
lpShellInfo.lpVerb := String2Psz("open")
lpShellInfo.lpFile := String2Psz(cFile)
lpShellInfo.nShow := SW_SHOWNORMAL
lpShellInfo.fMask := SEE_MASK_WAITFORINPUTIDLE

IF ShellExecuteEx (@lpShellInfo)
hProc := lpShellInfo.hProcess
ENDIF

instead of ShellExecute.

I already noted that on my system, with Word 2003, it worked fine. Our
change was that we displayed a preview while browsing through
documents. Word versions after 2003 are many times slower than 2003
and apparently fail to load in time, after which also the doubleclick
-which wasn't changed at all- fails.

The above code, especially the SEE_MASK_WAITFORINPUTIDLE, solves this
problem.

Dick 

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web