Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

New Post: problem with backgroundworker

0
0
that worked but not for all situations.

When I am running with in the ide or a compiled program with a visual interface that worked. Take the same code and put it into a windows application that I am running on the command line and it bombs, even with error trapping.

public bool WF_Script_Run(int Index)
        {

            bool retval = true;
            string errmsg = "";

            WF.SO.cancel = false;

            if (WF.OK && WF.SCEvent[Index])
            {
                try
                {
                    if ((int)WF.RunVersion < -10)
                    {
                        WorkflowJS.ExecuteCommand(WF.SCEvent_Names[Index]);
                    }
                    else
                    {
                        if (WorkflowVBS.CheckAccess())
                        {
                            WorkflowVBS.ExecuteCommand(WF.SCEvent_Names[Index]);
                        }
                        else
                        {
                            WorkflowVBS.Dispatcher.Invoke(new Action(() => WorkflowVBS.ExecuteCommand(WF.SCEvent_Names[Index])));
                        }
                    }
                }
                catch (Microsoft.ClearScript.ScriptEngineException EX)
                {
                    errmsg = EX.Message;
                }
                catch (Exception EX)
                {
                    errmsg = EX.Message;    

                }



            }

            return retval;
        }

Viewing all articles
Browse latest Browse all 2297