Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ShellExecuteA does not work in XP or 2003 server.

Status
Not open for further replies.

LordBios

Programmer
May 6, 2002
3
0
0
US
This code does not work on XP or 2003 server. Any ideas?
SELECT SXML-FILE ASSIGN TO WS-SXML-FILE-NAME
ORGANIZATION IS SEQUENTIAL
LOCK MODE IS MANUAL
ACCESS IS SEQUENTIAL
FILE STATUS IS 200-FILE-STATUS.
/
01 WS-OPERATION PIC X(005).
01 WS-FILE-NAME PIC X(255).
01 WS-PARAMETERS PIC X(255).
01 WS-DIRECTORY PIC X(255).
01 WS-RETURN-STATUS PIC X(005) COMP-5.
01 WS-SXML-PRINTER PIC X(255).

**********
010-EXECUTE-WINDOWS-NORMAL.
******************************************************************
* *
******************************************************************

MOVE SPACES TO WS-OPERATION.

STRING "Open" DELIMITED BY SPACE
X"00" DELIMITED BY SIZE
INTO WS-OPERATION.

MOVE WS-SXML-PRINTER TO WS-FILE-NAME.

MOVE WS-SXML-FILE-NAME TO WS-PARAMETERS.
MOVE SPACES TO WS-DIRECTORY.

CALL WINAPI "ShellExecuteA" USING BY VALUE 0 SIZE 4
BY REFERENCE WS-OPERATION
BY REFERENCE WS-FILE-NAME
BY REFERENCE WS-PARAMETERS
BY REFERENCE WS-DIRECTORY
BY VALUE 0 SIZE 4
RETURNING WS-RETURN-STATUS.
/
 
1) Are the first and sixth parameters are being taken as PIC S9(8) COMP-5 when they are passed and not text "F0" or "40"?

2) Are you passing ASCII or EBCDIC characters in your variables? Don't know the compiler you're using or how it works, so I have to ask that. Especially considering that it might be trying to be as mainframe compatible as possible.

3) Are you remembering to null-terminate all your variable parameters?


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top