Software Archive
Read-only legacy content
17060 ディスカッション

Systemqq

Intel_C_Intel
従業員
2,133件の閲覧回数
I tried using systemqq to launch winword, as follows:

l4 = systemqq('winword c:myfile.doc')

Apparently no success, as winword is not launched. However,
l4 is returned as .TRUE.

Was ist los?

LKD
0 件の賞賛
10 返答(返信)
Steven_L_Intel1
従業員
2,133件の閲覧回数
winword would have to be in your PATH to make this work.

Have you considered the ShellExecute API routine? You could use it to "open" the document. I have used this many times with great success. It will automatically open the document using the default associated with the file type, including web pages!

Steve
Intel_C_Intel
従業員
2,133件の閲覧回数
Ah yes, the path. Actually, I did use the complete path, but still no luck. I still can't figure out why winword is not launched. However, your suggestion to use ShellExecute is a much better idea, and I will try it later today.
lkd
P.. If I weren't already using CVF, I would certainly buy it based on the great support!
Steven_L_Intel1
従業員
2,133件の閲覧回数
If the complete path had spaces in it, you would need to enclose the path in "".

Steve
Intel_C_Intel
従業員
2,133件の閲覧回数
Tried ShellExecute today. Here is the command I used:

i4 = ShellExecute( GetHWndQQ(QWIN$FRAMEWINDOW), "OPEN", "c:2maxents.DOC", " ", " ", %VAL(0) )

i4 = 31 upon return. (No association for this file extension). I'm running all this under Win2000. I checked my associations. Indeed DOC is registered to Word.

What should I do next to figure out what the real problem is?

lkd
Steven_L_Intel1
従業員
2,133件の閲覧回数
ShellExecute is a Win32 routine, so all strings must be C strings - for example, "OPEN"C.

Steve
Intel_C_Intel
従業員
2,133件の閲覧回数
Yes, and so my MSDN documentation said. This was my first attempt:

i4 = ShellExecute( GetHWndQQ(QWIN$FRAMEWINDOW), "OPEN"C, "c:2maxents.DOC"C, " "C, " "C, %VAL(0) )

Returned i4 = 2 (File not found).

And my third attempt, assuming that I couldn't pass a null-terminated string in such an implicit way, was this:

str1 = "OPEN"C
str2 = "c:2maxents.DOC"C
str3 = ""C

i4 = ShellExecute( GetHWndQQ(QWIN$FRAMEWINDOW), str1, str2, str3, str3, %VAL(0) )

Returned i4 = 2 as above.

Question remains: Do you have any hints for debugging this?

lkd
Intel_C_Intel
従業員
2,133件の閲覧回数
This works

i4 = ShellExecute( GetHWndQQ(QWIN$FRAMEWINDOW), "OPEN"C, "2maxents.DOC"C, ""C, "c:"C, %VAL(0) )

This does not work

i4 = ShellExecute( GetHWndQQ(QWIN$FRAMEWINDOW), "OPEN"C, "c:2maxents.DOC"C, ""C, ""C, %VAL(0) )
nijhuis
ビギナー
2,133件の閲覧回数
LSD,

Your real problem is the backlash in the -string. "2" is a correct escape sequence in a -string and has the decimal value 2.
You should use a double backlash in the string: "I:2maxents.DOC"I

Gnus
nijhuis
ビギナー
2,133件の閲覧回数
LKD,

Sorry for the prior message. I misused the Spell Check.

Your real problem is the backslash in the C-string. "2" is a correct escape sequence in a C-string and has the decimal value 2.
You should use a double backslash in the string: "C:2maxents.DOC"C

Guus
Intel_C_Intel
従業員
2,133件の閲覧回数
Thanks Guus, that was EXACTLY the problem!

lkd
返信