Loading ...
Sorry, an error occurred while loading the content.

858RE: [cc2-dev-l] Re: since SetScriptCopy is non-blocking ....

Expand Messages
  • Peter Olsson
    Oct 21, 2010
    • 0 Attachment

      The ExecScriptCopy will put a command into the macro queue. The next command in the macro queue (might not be yours) will be executed *after* your command returns to the command line. The only way to do this is therefore:

       

      1.     Call AbortAllScripts() to make sure the macro queue is empty

      2.     Call ExecScriptCopy() with the macro to execute and your command name to return to the XP

      3.     Call CmdEnd() to terminate your command

      4.     Detect that you are reentering your command after the macro has been executed.

       

      The alternative is to use MYCMD and then return to MYCMD2 (but then you have to manually update the repeat command).

       

      Do you really need to call a macro command?

       

      Peter

       

      From: cc2-dev-l@yahoogroups.com [mailto:cc2-dev-l@yahoogroups.com] On Behalf Of Larry
      Sent: Thursday, October 21, 2010 12:12 AM
      To: cc2-dev-l@yahoogroups.com
      Subject: [cc2-dev-l] Re: since SetScriptCopy is non-blocking ....

       

       

      OK this is what I've tried ... to no avail:

      ExecScriptCopy(cmd);

      while(AskScript() != 0)
      {
      Sleep(500);
      }

      &&&&

      int _stdcall _AskScript()
      {
      int s;
      __asm mov s, eax;
      return s;
      }

      With a:

      #define AskScript _AskScript

      I really want to get past this issue, so please help!!!!!

      Lee

      --- In cc2-dev-l@yahoogroups.com, "Larry" <saunderl@...> wrote:

      >
      > Hey Everyone,
      >
      > I need some help. I'm using SetScriptCopy and after a lot of
      trial-and-error, I've learned that SetScriptCopy is not blocking.
      >
      > I need to be able to call SetScriptCopy and not leave the function until
      the script is finished (ie, I need to block further execution of my code until SetScriptCopy is done.
      >
      > And after looking in FCW32.TXT that is fairly obvious. :-)
      >
      > Mainly because there exists two other commands:
      > 1 - SetScriptsDone
      > 2 - AskScript
      >
      > Would it be better so use the callback function (SetScriptsDone) or go
      into a tight loop checking (AskScript) after the call to SetScriptCopy?
      >
      > The reason I ask (as everyone knows, I'm not an expert at C/C++) is that
      callbacks are not my strong point.
      >
      > How would you use SetScriptsDone in a blocking manner?
      > How would I use AskScript in a blocking manner?
      >
      > If anyone has examples and the Glue rountines to call them, thanks!
      >
      > L. Lee Saunders
      >

    • Show all 4 messages in this topic