Can anyone please tell me how to access a named windows pipe using cobol 97?
I think i need to use API but don't really understand how. I have examples from fujitsu of API and I think I need to link kernel32.lib in somehow but the rest is a mystery!
Thanks
Thank you for replying. I've made some progress. It seems that when trying to call "CallNamedPipe" (from Kernel32.lib) I didn't have the right amount of parameters and it would not let me link the program. Now if anyone knows what I should be putting in for the parameters of "CallNamedPipe" that might help me get further!
thanks
Tony
Take care using Api calls.
There are few things you have to know before use any Api calls.
First of all, search on the "Kernel32.lib" file with a normal text editor like Notepad, for the word (function) you want to use: "CallNamedPipe".
Normally, an Api call can be made in Ascii mode.
Seeing the result editing, we found that the "CallNamedPipe" has an "A" suffix at end of its name.
This could means the call must be done in Ascii mode like:
CALL "CallNamedPipeA" WITH STDCALL LINKAGE
USING by value parm1
by value parm2
by value parm2
Of course, the "Kernel.lib" file must be included on the project as an external resource.
Each of these "parm" fields must be defined PIC S9(9) COMP-5.
The value "28" you will find searching on the "Kernel32.lib", means that the call need 3 parameters passed from the caller and each parm must be declared as a long field (S9(9) COMP-5).
An advice: you can download a good api reference from
Declare Function CallNamedPipe Lib "kernel32" Alias "CallNamedPipeA" (ByVal lpNamedPipeName As String, lpInBuffer As Any, ByVal nInBufferSize As Long, lpOutBuffer As Any, ByVal nOutBufferSize As Long, lpBytesRead As Long, ByVal nTimeOut As Long) As Long
Note that the "string" must be declared on cobol BY REFERENCE and each "long" field must be PIC S9(9) COMP-5.
About the type "Any", you can use string or numeric fields.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.