0

I am deploying a C# application on client machine. The Application need to access code from another program, so it can scrap text from the screen of another application. It is running fine on the development machine but on the client machine it is throwing an error "ActiveX Component cannot create Object" this is where i am getting the error from!

    private ExtraSession objExtraSession;
    private ExtraSessions objExtraSessions;
    private ExtraScreen objExtraScreen;
    private ExtraArea objExtraArea;
    private ExtraSystem objExtraSystem;
    protected void sessionInitializer()
    {
        try
        {
            objExtraSystem = (ExtraSystem) Microsoft.VisualBasic.Interaction.CreateObject("Extra.system");

            if (objExtraSystem == null)
            {
                MessageBox.Show("Could not create system");
                return;
            }
            objExtraSessions = objExtraSystem.Sessions;

            if (objExtraSessions == null)
            {
                MessageBox.Show("Could not create sessions");
                return;
            }
            if (!System.IO.File.Exists("C:\\Users\\" + userid + "\\Documents\\Attachmate\\EXTRA!\\Sessions\\SAS.edp"))
            {
                MessageBox.Show("File does not exist");
                return;
            }

            objExtraSession = (ExtraSession) Microsoft.VisualBasic.Interaction.GetObject("C:\\Users\\"+ userid + "\\Documents\\Attachmate\\EXTRA!\\Sessions\\SAS.edp");

            if (objExtraSession == null)
            {
                MessageBox.Show("Could not create session");
                return;
            }

            if (objExtraSession.Visible == 0)
            {
                objExtraSession.Visible = 1;
            }

            objExtraScreen = objExtraSession.Screen;
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.StackTrace, "Failed to initialize Attachmate sessions");
        }
    }

The error is generated from objExtraSession = (ExtraSession) Microsoft.VisualBasic.Interaction.GetObject("C:\Users\"+ userid + "\Documents\Attachmate\EXTRA!\Sessions\SAS.edp");

Am I missing some step. Please help me out. Thanks in advance.

4
  • Please show us your code, otherwise how can we help you? Commented Dec 9, 2013 at 20:06
  • Also, use the correct tags. Commented Dec 9, 2013 at 20:06
  • @ Bob are you using Vista Commented Dec 9, 2013 at 20:08
  • Am using windows 7 on the development computer as well as on client's computer Commented Dec 9, 2013 at 23:29

2 Answers 2

4

The most likely explanation is that your development machine has the ActiveX control installed, but the client machine does not. Read the deployment documentation for the control and do what is says is required to deploy to the client machine.

Sign up to request clarification or add additional context in comments.

Comments

0

Thanks for all your responses... The method GetObject was creating an object whose activex component was not registered... I resolved by finding the corresponding *.ocx file and calling Regsvr32 on the file this resolved the problem...

1 Comment

can you exaplain with more detail how you solve your problem?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.