Solved

Dynamic function call on VMS

Posted on 2000-04-13
2
204 Views
Last Modified: 2010-04-15
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?
0
Comment
Question by:jvinicius
2 Comments
 
LVL 1

Expert Comment

by:syscyk
ID: 2716297
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
 
LVL 4

Accepted Solution

by:
stass earned 60 total points
ID: 2735861
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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now