使用DDE在Windows 7中运行旧程序时出现问题

时间:2011-04-06 21:27:48

标签: windows windows-7 dde progress-4gl openedge

我的管理员遇到了一个大问题,我正在将他们的困境转移到SO:

我们有一个遗留数据库应用程序(在Progress 4GL / OpenEdge中编写),可以调用 WordPerfect X3 来生成报告。 WordPerfect可执行文件的路径在数据库应用程序中进行了硬编码,以及要插入数据库的扫描PDF的位置,我们无法修改程序。 / p>

我们的大多数工作站已成功从 WinXP 迁移到 Win7 ,旧版应用程序正常工作直到尝试调用WordPerfect,说无法找到可执行文件(即使X3安装在WinXP上使用的完全相同的路径中)...与扫描的文档文件夹相同。

有什么建议吗?


更新

我今天早上花了一些时间帮助我的管理员提供了你们提供的各种建议......我们检查了文件权限,用十六进制编辑器查看了编译的(.r)文件(感谢@Tom和@Ernest),并且做了使用Notepad ++在所有源代码(.p)中搜索文件

以下是我发现的内容: 该程序没有直接调用WordPerfect(,因为我最初被告知),而是使用DDE。这是Progress 4GL产生的错误消息:

DDE INITIATE Failed. (3153)

我知道DDE和Win7存在问题,所以我想知道是否有一个解决方法,可能需要修改的注册表项或影响的东西。

我在下面的源代码中加入了一段摘录,希望有人能够识别正在发生的事情(我不熟悉Progress 4GL,所以这对我来说都是希腊语):

/* setup DDE communicaiton with WordPerfect 12   */
/* and perform the merge of the various document */

DEFINE VARIABLE sys             AS INTEGER NO-UNDO.
DEFINE VARIABLE mline           AS CHAR FORMAT "x(220)" NO-UNDO.
DEFINE VARIABLE intResult       AS INTEGER NO-UNDO.
DEFINE VARIABLE err-status AS INTEGER.

{GLOBVAR.I}
DEFINE VAR C-Win AS WIDGET-HANDLE NO-UNDO.

DEFINE FRAME FRAME-b
    WITH 1 DOWN KEEP-TAB-ORDER OVERLAY 
         SIDE-LABELS NO-UNDERLINE THREE-D 
         AT COL 13 ROW 4.1
         SIZE 11 BY 2
         TITLE "FRAMEWP".

IF SESSION:DISPLAY-TYPE = "GUI":U THEN
  CREATE WINDOW C-Win ASSIGN
         HIDDEN             = YES
         HEIGHT             = 4
         WIDTH              = 20
         MAX-HEIGHT         = 4
         MAX-WIDTH          = 20
         VIRTUAL-HEIGHT     = 4
         VIRTUAL-WIDTH      = 20
         RESIZE             = yes
         SCROLL-BARS        = no
         STATUS-AREA        = no
         BGCOLOR            = ?
         FGCOLOR            = ?
         KEEP-FRAME-Z-ORDER = yes
         THREE-D            = yes
         MESSAGE-AREA       = no
         SENSITIVE          = YES.

IF SESSION:DISPLAY-TYPE = "GUI":U AND VALID-HANDLE(C-Win)
THEN C-Win:HIDDEN = NO.
  VIEW FRAME DEFAULT-FRAME IN WINDOW C-Win.
  VIEW FRAME FRAME-b IN WINDOW C-Win.
  C-Win.

ENABLE ALL WITH FRAME FRAME-B TITLE "".
ASSIGN FRAME FRAME-B:VISIBLE = FALSE. 

OS-DELETE VALUE(pass-txtout).
PAUSE 1 NO-MESSAGE IN WINDOW c-win.
OS-DELETE VALUE(pass-mergedoc).

pass-shelldoc = '"' + trim(pass-shelldoc) + '"'.
pass-shelldoc = TRIM(pass-shelldoc).

pass-txtfile = '"' + TRIM(pass-txtfile) + '"'.
pass-txtfile = TRIM(pass-txtfile).

pass-txtout = '"' + TRIM(pass-txtout) + '"'.
pass-txtout = TRIM(pass-txtout).

pass-mergedoc = '"' + TRIM(pass-mergedoc) + '"'.
pass-mergedoc = TRIM(pass-mergedoc).

DDE INITIATE sys FRAME FRAME FRAME-B:HANDLE APPLICATION "wpwin13_macros" TOPIC "COMMANDS".

/* create a wp doc from the pass-txtfile just created */
mline = "Application (WordPerfect; " + '"WordPerfect"' + '; Default!; "EN")'.
mline = TRIM(mline).
DDE EXECUTE sys COMMAND mline.

mline = "FileNew ()".
mline = TRIM(mline).
DDE EXECUTE sys COMMAND mline.

mline = "ImportSetFileName (Filename: " + pass-txtfile + ")".
mline = TRIM(mline).
DDE EXECUTE sys COMMAND mline.

mline = "ImportSetSource (SourceType: ASCII!)".
mline = TRIM(mline).
DDE EXECUTE sys COMMAND mline.

mline = "ImportSetDestination (DestinationType: MergeData!)".
mline = TRIM(mline).
DDE EXECUTE sys COMMAND mline.

mline = "ImportSetSizeToFit (State: No!)".
mline = TRIM(mline).
DDE EXECUTE sys COMMAND mline.

mline = "ImportSetAsciiFieldDelimiter (FieldDelimiter: " + '"^"' + ")".
mline = TRIM(mline).
DDE EXECUTE sys COMMAND mline.

mline = "ImportSetAsciiRecordDelimiter (RecordDelimiter: " + '"%"' + ")".
mline = TRIM(mline).
DDE EXECUTE sys COMMAND mline.

mline = "ImportSetAsciiStrip (StripChars: " + '""' + ")".
mline = TRIM(mline).
DDE EXECUTE sys COMMAND mline.

mline = "ImportSetAsciiEncap (EncapsulationChar: " + '"""' + '""' + ")".
mline = TRIM(mline).
DDE EXECUTE sys COMMAND mline.

mline = "ImportDoImport ()".
mline = TRIM(mline).
DDE EXECUTE sys COMMAND mline.

mline = "WAIT(10)".
mline = TRIM(mline).
DDE EXECUTE sys COMMAND mline.

mline = "FileSave (Filename: " + pass-txtout + "; ExportType: WordPerfect_6_7_8!; yes!)".
mline = TRIM(mline).
DDE EXECUTE sys COMMAND mline.

mline = "Close()".
mline = TRIM(mline).
DDE EXECUTE sys COMMAND mline.

/* perform the merge using sheldoc, pass-txtout and pass-shelldoc */
mline = "Application (WordPerfect; " + '"WordPerfect"' + '; Default!; "EN")'.
mline = TRIM(mline).
DDE EXECUTE sys COMMAND mline.

mline = "MergeRUN(Formfile!;" + pass-shelldoc + ";DataFile!;".
mline = TRIM(mline).
DDE EXECUTE sys COMMAND mline.

mline = mline + pass-txtout + ";TOFILE!;" + pass-mergedoc + ")".
mline = TRIM(mline).
DDE EXECUTE sys COMMAND mline.

mline = "CLOSE()".
mline = TRIM(mline).
DDE EXECUTE sys COMMAND mline.

IF substring(pass-mergedoc,16,3) = "D12" THEN.
ELSE
    DO:
    mline = "FileOpen (Filename: " + pass-mergedoc + ")".
    mline = TRIM(mline).
    DDE EXECUTE sys COMMAND mline.

    mline = "AppMaximize ()".
    mline = TRIM(mline).
    DDE EXECUTE sys COMMAND mline.

    mline = "APPRESTORE ()".
    mline = TRIM(mline).
    DDE EXECUTE sys COMMAND mline.
    END.

DDE TERMINATE sys NO-ERROR.
 :
 :

2 个答案:

答案 0 :(得分:1)

你有“无法修改”的程序文件实际上可以用十六进制编辑器进行编辑;在那一天做了很多次。这些路径几乎肯定会以可读的文本格式位于二进制文件中。

除此之外,您可以在VM映像(即VMware播放器)中运行XP并在其上安装程序;他们可能会更快乐。

答案 1 :(得分:0)

我同意这听起来很像权限问题。

尽管如此......你确定你无法修改它吗?这不是供应商通常提供的那种功能 - 听起来更像是自定义修改。

你有.p或.w文件吗? (这些是Progress 4GL源代码。)或仅.r文件? (这是已编译的代码。)

运行“showcfg”(开始菜单上的“配置”图标) - 如果你有开发许可证,可能更多的是不知道如何更改它而不是无法更改它。