Re: simple thread




"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.





.



Relevant Pages

  • Async Timeout events for TCP connections.
    ... Is it possible in .Net to define a async timer callback. ... The reason I want to do this is to handle host being down that I am ... Then after a timeout automatically ... callback which if not cancelled executes within 15 seconds. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Running a job on a remote machine (and continues "here" after its done)
    ... My software uses Tcl/Tk as the scripting language, ... The Tcl/Tk shell (let's call it Host) sit on a Windows machine ... The basic setup for this is simple, just set the correct ip and port (or ... proc callback { ...
    (comp.lang.tcl)
  • Re: Couldnt help but laugh
    ... Chinese flag at both ceremonies. ... all host countries have to be allowed to do it. ... Many symbols associated with the Olympics took on an official form ... nation and the flag of the next host nation. ...
    (alt.usage.english)
  • Re: USB port hangs
    ... I found that the flag HCD_SUSPEND_RESUME in the flag HcdCapability ... a 4 the USB host does not have any problems with any floppies. ... caused the suspend does not cause the host to unload the driver and ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Couldnt help but laugh
    ... The City of Orlando is prepared, then, to host the Olympics. ... has been an official City of Orlando flag since 1980. ... If the blue at the bottom of the flag represents water, ...
    (alt.usage.english)