Home > Archive > Cobol > July 2004 > interacting with an ACUCOBOL application
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
interacting with an ACUCOBOL application
|
|
| Mark_R 2004-06-29, 8:55 pm |
| Good day,
I am writing an application in Delphi. I want it to interact with
another application. The ACUCOBOL application is successfully calling
a DLL passing my application a string and a number. I want to be able
to send him the same. Can ACUCOBOL "listen" for DLL messages? Anybody
have any code on that. The ACUCOBOL team that I am working with is
relatively new to windows programming.
Thanks for any info.
-Markus
| |
|
| By "DLL messages", you mean sending messages to the Acucobol window - you
could do that, but it's not the easiest or best way. (If I recall, Acucobol
provides hooks where you can subclass the main window so you can intercept
messages, but this requires writing some C code and relinking the runtime.)
They can just pass you additional variables in their CALL of your DLL and
your DLL can just put the values you want to pass back using the pointers to
those variables. Or if they want, you can overwrite the values in the
variables they are passing to you. Have them take a look at the docs on the
CALL verb.
"Mark_R" <mrissmann@yahoo.com> wrote in message
news:7a1f4dab.0406291440.170f3425@posting.google.com...
> Good day,
>
> I am writing an application in Delphi. I want it to interact with
> another application. The ACUCOBOL application is successfully calling
> a DLL passing my application a string and a number. I want to be able
> to send him the same. Can ACUCOBOL "listen" for DLL messages? Anybody
> have any code on that. The ACUCOBOL team that I am working with is
> relatively new to windows programming.
>
> Thanks for any info.
>
> -Markus
| |
| Mark_R 2004-06-30, 3:55 pm |
| Thanks for the suggestion but their current calls to my DLL are
unrelated to what I want to do here. When ever an certain event occurs
in my application I need to notify their application of the event and
pass some information over.
I am not set on a using a DLL. Are there any other options? ActiveX?
Thanks,
-Markus
"JJ" <jj@nospam.com> wrote in message news:<R6qdnRNAQY1Tg3_dRVn-hg@comcast.com>...
> By "DLL messages", you mean sending messages to the Acucobol window - you
> could do that, but it's not the easiest or best way. (If I recall, Acucobol
> provides hooks where you can subclass the main window so you can intercept
> messages, but this requires writing some C code and relinking the runtime.)
>
> They can just pass you additional variables in their CALL of your DLL and
> your DLL can just put the values you want to pass back using the pointers to
> those variables. Or if they want, you can overwrite the values in the
> variables they are passing to you. Have them take a look at the docs on the
> CALL verb.
| |
| E P Chandler 2004-06-30, 8:55 pm |
| mrissmann@yahoo.com (Mark_R) wrote in message news:<7a1f4dab.0406300656.fd4c35d@posting.google.com>...
> Thanks for the suggestion but their current calls to my DLL are
> unrelated to what I want to do here. When ever an certain event occurs
> in my application I need to notify their application of the event and
> pass some information over.
>
> I am not set on a using a DLL. Are there any other options? ActiveX?
>
> Thanks,
>
> -Markus
>
It sounds like what you want to do is in your ACUCOBOL main program is
create what in C or C++ would be a CALLBACK function. I have no idea
if ACUCOBOL provides that facility.
A quick Google search reveals a bit of discussion on linking external
C/C++ routines to the COBOL runtime, which of course isn't what you
want.
| |
| Paul Raulerson 2004-06-30, 8:55 pm |
| Well, I am not entirely clear what platform you are on, but have you
looked into the platform's IPC capabilities?
For example, under UNIX or (I think!) Windows, you should be able to
build message queues and have a thread sitting there waiting on input
to the queue.
This is basically now 'event' notification works under Windows and X.
There are several other possibilities- message queues, shared memory,
semaphores, mutexs and so on.
All of which, however, involve calling an operating system resource,
which may or may not be easily done from modern AcuCobol. I tend to
think
it may be done with little effort, but I won't guarantee that.
I can give you samples of how to do it under UNIX, but the samples are
in C. :)
-Paul
mrissmann@yahoo.com (Mark_R) wrote in message news:<7a1f4dab.0406300656.fd4c35d@posting.google.com>...[color=darkred]
> Thanks for the suggestion but their current calls to my DLL are
> unrelated to what I want to do here. When ever an certain event occurs
> in my application I need to notify their application of the event and
> pass some information over.
>
> I am not set on a using a DLL. Are there any other options? ActiveX?
>
> Thanks,
>
> -Markus
>
>
> "JJ" <jj@nospam.com> wrote in message news:<R6qdnRNAQY1Tg3_dRVn-hg@comcast.com>...
| |
|
| You might be able to do it by making your DLL an ActiveX control, and then
firing an event when you want to pass back data, but their Acucobol program
will need to be in an ACCEPT of a screen section entry containing that
control to get the event. It's not just going to asynchronously interrupt
their program - there has to be an active ACCEPT.
The only other way I can think of is that they could use the mswinsub.c,
which has a startup function that gets called after the main window is
created and you might be able to use that to subclass (or is it superclass?)
the window so it could intercept the messages in the message loop - but then
I'm not sure what they would do with them....
"Mark_R" <mrissmann@yahoo.com> wrote in message
news:7a1f4dab.0406300656.fd4c35d@posting.google.com...
> Thanks for the suggestion but their current calls to my DLL are
> unrelated to what I want to do here. When ever an certain event occurs
> in my application I need to notify their application of the event and
> pass some information over.
>
> I am not set on a using a DLL. Are there any other options? ActiveX?
>
> Thanks,
>
> -Markus
>
>
> "JJ" <jj@nospam.com> wrote in message
news:<R6qdnRNAQY1Tg3_dRVn-hg@comcast.com>...[color=darkred]
you[color=darkred]
Acucobol[color=darkred]
intercept[color=darkred]
runtime.)[color=darkred]
and[color=darkred]
pointers to[color=darkred]
the[color=darkred]
| |
| Mark_R 2004-07-01, 3:55 pm |
| Hey Guys,
Thanks for the help. I will look into all the suggestions! I will try
to get the AcuCobol team to post their findings here.
-Markus
"JJ" <jj@nospam.com> wrote in message news:<BoKdndBlCrLu8n7d4p2dnA@comcast.com>...
> You might be able to do it by making your DLL an ActiveX control, and then
> firing an event when you want to pass back data, but their Acucobol program
> will need to be in an ACCEPT of a screen section entry containing that
> control to get the event. It's not just going to asynchronously interrupt
> their program - there has to be an active ACCEPT.
>
> The only other way I can think of is that they could use the mswinsub.c,
> which has a startup function that gets called after the main window is
> created and you might be able to use that to subclass (or is it superclass?)
> the window so it could intercept the messages in the message loop - but then
> I'm not sure what they would do with them....
>
|
|
|
|
|