Re: Question on Externals

Scott Raney ((no email))
Mon, 9 Jan 95 11:01:43 MST

> i have gone through the tutorials and see how XtTemplate.c and External.c
> basically work. thus, i am trying to use an external C program to launch
> metacard, etc. much like the XT demo. however, the twist I have is that i
> want metacard to make a couple function calls back to the C program, like
> the external.c demo. i guess i want the functionality of both. is there an
> easy way to modify the two sets of files to do this.

To be honest, I don't know if you can do this or not. The interface
certainly wasn't designed to support this, but since the protocols are
the same for the Xt communcation and the external communication, it
should be possible to have both kinds work with an Xt application.
Some low level hacking of the XtGlue.c file would be required,
however.

But there may be an easier way: instead of using the SendCardMessage
call as in the XtTemplate.c example, consider using EvalExp to call a
function in your stack instead. The function could change the card
(or whatever else you wanted to do) and then return a string that
tells the Xt application what to do next (like make a SetGlobal call
to return some information). The downside of this approach is that
MetaCard can't initiate a call to the the Xt application, it can only
respond to requests made by the other program.
Scott

PS: I'll put support for bidirectional communcation with the Xt
application on the feature request list for the 2.0 release.

> -jim
>
> *******************************************************************
> * James M. Cardinal *
> * Graduate Research Associate *
> * Life-Cycle Design Lab & ERC/NSM, The Ohio-State University *
> * Phone: (614) 292 - 2849 *
> *******************************************************************

-- 
***********************************************************************
* Scott Raney  303-447-3936            Remember: the better you look, *
* raney@metacard.com                   the more you'll see -- Lidia   *
***********************************************************************