Select to view content in your preferred language

What is Error error: 80040111, Please

6448
4
Jump to solution
07-24-2012 09:02 AM
BernardoG_
Emerging Contributor
Using this sample code :

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.Geometry;

namespace Arc_1
{
    public partial class Form1 : Form
    {
        private string path = @"D:\ArcObjects\myfGDB.gdb";
        public Form1()
        {
            InitializeComponent();
        }
      
        public static IWorkspace FileGdbWorkspaceFromPath(String path)
        {
            Type factoryType = Type.GetTypeFromProgID("esriDataSourcesGDB.FileGDBWorkspaceFactory");
            IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)Activator.CreateInstance(factoryType);
            return workspaceFactory.OpenFromFile(path, 0);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            FileGdbWorkspaceFromPath(path);
            MessageBox.Show("You are connected now");
        }
    }
}


But I am encountering with this error
Retrieving the COM class factory for component with CLSID {71FE75F0-EA0C-4406-873E-B7D53748AE7E} failed due to the following error: 80040111.

I changed the project .Net framework from 4 to 3.5 client but smae thing still happening!
Can you please let me know why this is happening?
Thanks
0 Kudos
1 Solution
4 Replies
NeilClemmons
Honored Contributor
Are you running this code inside of ArcMap?  If not, then you need to check out a license prior to calling any ArcObjects.  If you are using ArcGIS 10, then you also need to bind to a product before attempting to check out the license.
0 Kudos
BernardoG_
Emerging Contributor
Hi Neil,
No , I am running the code with VS 2010.Yes I am using ArcGIS 10.Can you please let me know how I can set the license checkout process? and can you please let me know what exactly you mean by this part of your comment?
If you are using ArcGIS 10, then you also need to bind to a product before attempting to check out the license.


Thanks for your time and comment,
0 Kudos
BernardoG_
Emerging Contributor
0 Kudos