here you can see why you need use activator: ArcObjects 10 .NET SDK Help
If you need to use an activator, why does Esri produce samples that do not use this method?
Set Data Source Snippet
And why does it sometimes work? E.g. calling
IWorkspaceFactory workspaceFactory = new SdeWorkspaceFactory();
at 10.2 works for me, but at 10.0 it does not.
Also I can call new FileGDBWorkspaceFactoryClass() at 10.0, even though it is also a singleton.
Type t = Type.GetTypeFromProgID("esriDataSourcesGDB.SdeWorkspaceFactory"); System.Object obj = Activator.CreateInstance(t); IWorkspaceFactory sdeWorkspaceFactory= obj as IWorkspaceFactory;
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.