• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 834
  • Last Modified:

Call a DLL on Windows from AS400

Is it  possible to Invoke/Call a DLL on a windows Platform From an AS/400 passing it various Parameters and then wait until a return value is received.
Thanks for your help in Advance.
0
Philip_Lang
Asked:
Philip_Lang
  • 3
1 Solution
 
daveslaterCommented:
Hi
The only way I know of doing it  is write a VB/C++ etc program that reads a reques from a dataq calls the DLL and sents the result back via the dataq

dataq access is part of client  access and there are may examples provided by IBM.

Let me know if you need more details on dataq's

dave
0
 
daveslaterCommented:
Or if it is interactive
Your could write the parms to a file in QDLS or the IFS,
use
STRPCO
and
STRPCCMD
to run a PC program to read the parms, write the data back to a file and read it.

Dave
0
 
xingerCommented:
Never tried it, but perhaps the following about rundll32.exe will give you another direction to look...
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tools/tools/rundll32.asp
0
 
SuperCCACommented:
A little more infromation on the underlying requirement might help as you will not be able to access any DLL function directly. The interfaces described above only work for an executable file. The data queues suggestion is solid but it will mean that the iSeries session will need to wait for a reply but full consideration must be given to the possibility of the PC program not responding.

You can pass parameters to an exceutable PC file via the command line on the STRPCCMD but there is no capability to return a value.

If you wanted to get cute you could:
1. initiate a PC program passing parameters via STRPCCMD.
2. get that PC program to acquire the iSeries session using EHLLAPI
3. once the PC program has calcaulated the response this could be posted into a hidden field again using EHLLAPI
4. the PC program could then send an AID key to the iSeries session so that it reads the hidden firled
5. Release the EHLLAPI lock in the PC program and end the PC program

This will work but may over-engineer your problem.
0
 
daveslaterCommented:

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept DaveSlater comment as answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
Dave Slater
Page Editor


0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now