Re: simple thread
- From: "Cox News" <spamhater@xxxxxxxxx>
- Date: Wed, 24 Aug 2005 23:19:15 -0700
"Jamie" <jamie_5_not_valid_after_5_Please@xxxxxxxxxxx> wrote in message
news:h2aPe.11690$ih4.8643@xxxxxxxxxxx
> Nomen Nescio wrote:
>
> > What is the very simplest way for procedure A to call procedure B, so
that procedure B only executes after procedure A has returned?
> >
> > This is a COM interface. There is no main program available to call
them serially.
> >
> why not call procedure A with in the start of procedure B?
> or if you are trying so flow control to force the
> interface to take steps in the order you want them? then
> try setting a flag in procedure A that indicates the
> Procedure B can be called now. when the Host calls them
> in the proper order procedure B can test for this flag
> and if set, execute the code other wise, return an error.
> this is assuming your trying to control host apps for
> proper sequence of steps.
> P.S.
> after Procedure B has executed you should clear the
> flag.
> etc..
>
>
> --
> Real Programmers Do things like this.
> http://webpages.charter.net/jamie_5
>
Thank you for responding Jamie. This COM automation object is only allowed
to hook into a few event driven procedures that it is derived from. The
host program calls my procedure A when a certain event occurs. Procedure A
is supposed to return an integer value back to the host which will indicate
a sales order number that will forever be used to reference any changes to
that order. My Procedure B is called by me to indicate when the order is no
good and to cancel it. My problem is that I want to call Procedure B
immediately in the case that the order submition (part of Procedure A)
doesn't go through. But I can't call Proc B until Proc A has returned an
order number back to the host. Otherwise Proc B doesn't know what reference
number to cancel.
I can set a global flag and write an event to wait for it to get the order
number, but Proc A still has to return first. Or I can spawn a thread when
Procedure A is called by the host, and have that thread wait for Procedure A
to end. Either way sounds messy and I don't know how to code it.
.
- References:
- simple thread
- From: Nomen Nescio
- Re: simple thread
- From: Jamie
- simple thread
- Prev by Date: Re: simple thread
- Next by Date: Re: Looping thru components
- Previous by thread: Re: simple thread
- Index(es):
Relevant Pages
|