• C

Dynamic function call on VMS

Is it possible to develop something to work as a DLL on VMS operating system using C? In other words, how can make functions able to be dynamic called by other programs in that OS?
jviniciusAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
stassConnect With a Mentor Commented:
Yes of course.
for more information go to http://www.openvms.compaq.com:8000/index.html and read documentation "Linker utility manual"

Example:
source for DLL module
[--cut--]
int dll_func01()
 {
   ...
 }
[--cut--]

compile source to object cc FILE.C will produce FILE.OBJ

command file to  make dll (shared library in VMS terms) on alpha:
[--cut--]
$link /share FILE.OBJ, - sys$input:/options
symbol_vector = (dll_func01 = procedure)
[--cut--]
this command file produce dll FILE.EXE
simple command file to link with this dll
[--cut--]
$link my_program, sys$input:/options
file.exe/share
[--cut--]
0
 
syscykCommented:
One thing that I did in VMS was to write a process that blocked on an IP port, waiting for clients.  When a request came, I spawned a thread that serviced the request and sent the answer back to the caller, then terminated itself.  Of course, you have to figure an interface between client and server process, but it isn't too hard.  As you add functions to the server, the client just has to know how to ask for them. I simply numbered them.  So, a request message might look like this:
FUNCTION NUMBER:FUNCTION PARAM1:PARAM2:RETURN BUFFER
and so on.  Send this message to the server process via TCP/IP, however you want.
   This scheme actually works, and I had a server like this in production for years.  The good part is, the client can be a process on the VAX, or a PC client on the network who can do TCP/IP calls.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.