<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: IWorkspaceFactoryStatus Example in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/iworkspacefactorystatus-example/m-p/408367#M10943</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Domenico and Freddie,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see your point clearly. I will definitely use Activator.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I do not understand in my old project&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 13.3333px; line-height: 20px;"&gt; (in comparison with ESRI example)&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5;"&gt; - &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5;"&gt;How can I obtain all currently open workspaces&amp;nbsp; "from air"?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;How that "magic" happens?&lt;/P&gt;&lt;P&gt;See the code from my project here&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/167371"&gt;Reconnect to SDE by IWorkspaceFactoryStatus causes errors&lt;/A&gt; &lt;/P&gt;&lt;P&gt;See the ESRI help&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.arcgis.com/EN/sdk/10.0/ArcObjects_NET/componenthelp/index.html#/IWorkspaceStatus_Interface/002500000mrn000000/" title="http://help.arcgis.com/EN/sdk/10.0/ArcObjects_NET/componenthelp/index.html#/IWorkspaceStatus_Interface/002500000mrn000000/"&gt;ArcObjects 10 .NET SDK Help&lt;/A&gt;&lt;/P&gt;&lt;H4 class="dtH4" style="font-size: 1.5em; color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif; margin-bottom: 0.4em; margin-top: 1em; margin-left: -18px;"&gt;&amp;nbsp;&amp;nbsp; Remarks&lt;/H4&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana; font-size: 11.3333px;"&gt;The &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Verdana; font-size: 11.3333px;"&gt;&lt;STRONG&gt;I&lt;STRONG&gt;WorkspaceFactoryStatus::WorkspaceStatus&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Verdana; font-size: 11.3333px;"&gt; property returns an enumeration of &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Verdana; font-size: 11.3333px;"&gt;&lt;STRONG&gt;I&lt;STRONG&gt;WorkspaceStatus&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Verdana; font-size: 11.3333px;"&gt; objects for all currently open workspaces.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Oct 2015 00:19:54 GMT</pubDate>
    <dc:creator>MarkMindlin</dc:creator>
    <dc:date>2015-10-27T00:19:54Z</dc:date>
    <item>
      <title>IWorkspaceFactoryStatus Example</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/iworkspacefactorystatus-example/m-p/408364#M10940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;Hi there,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;I need an explanation about the interface IWorkspaceFactoryStatus.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;I have an old project that I investigate an error (I described in another discussion).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;But what is the difference &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;1. (in my old project):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;SPAN style="color: #2b91af;"&gt;IWorkspaceFactoryStatus&lt;/SPAN&gt; pWorkspaceFactoryStatus = new ESRI.ArcGIS.DataSourcesGDB.SdeWorkspaceFactoryClass();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;2. ESRI example&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;SPAN style="color: #2b91af;"&gt;IWorkspaceFactoryStatus&lt;/SPAN&gt;&lt;SPAN style="color: #000066;"&gt; workspaceFactoryStatus = (&lt;/SPAN&gt;&lt;SPAN style="color: #2b91af;"&gt;IWorkspaceFactoryStatus&lt;/SPAN&gt;&lt;SPAN style="color: #000066;"&gt;)workspaceToCheck.WorkspaceFactory;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;I see that example here (see the link)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;A href="http://resources.esri.com/help/9.3/arcgisengine/arcobjects/esriGeoDatabase/IWorkspaceFactoryStatus_Example.htm" title="http://resources.esri.com/help/9.3/arcgisengine/arcobjects/esriGeoDatabase/IWorkspaceFactoryStatus_Example.htm"&gt;IWorkspaceFactoryStatus Example&lt;/A&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;I know about Activator and singleton, I need an explanation WHY the number one (1. (in real project)) works.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;10.3, Desktop, .Net 3.5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;Any help would be highly appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Oct 2015 23:00:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/iworkspacefactorystatus-example/m-p/408364#M10940</guid>
      <dc:creator>MarkMindlin</dc:creator>
      <dc:date>2015-10-25T23:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: IWorkspaceFactoryStatus Example</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/iworkspacefactorystatus-example/m-p/408365#M10941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;in section "Singletons and System.__COMObject" &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fhelp.arcgis.com%2Fen%2Fsdk%2F10.0%2FArcobjects_net%2Fconceptualhelp%2Findex.html%23%2FInteracting_with_singleton_objects%2F00010000043p000000%2F" rel="nofollow" target="_blank"&gt;http://help.arcgis.com/en/sdk/10.0/Arcobjects_net/conceptualhelp/index.html#/Interacting_with_singleton_objects/00010000043p000000/&lt;/A&gt;&lt;SPAN&gt; there is the detail why use Activator class instead of the new keyword to instantiate singletons&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2015 08:41:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/iworkspacefactorystatus-example/m-p/408365#M10941</guid>
      <dc:creator>nicogis</dc:creator>
      <dc:date>2015-10-26T08:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: IWorkspaceFactoryStatus Example</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/iworkspacefactorystatus-example/m-p/408366#M10942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I used to have an example that showed proof of this error a couple of years ago, but I haven't been to recreate it so far today. The answer to your question will probably be best described on the page mentioned by Domenico. You'll want to note that the page says "&lt;STRONG&gt;Sometimes&lt;/STRONG&gt; when you use the new keyword to instantiate a COM object, you are getting a referent to an object that exists...If your code has encountered this error situation, you &lt;STRONG&gt;might&lt;/STRONG&gt; receive an error, such as Unable to cast objecvt of type System.__ComObject to type &amp;lt;Typename&amp;gt;."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue is more about a best practice. For a majority of people they'll continue to use the new keyword and they'll never run into this problem. The best practice to avoid this error if you were to ever run into it would be to use the Activator, but it's really up to the programmer to determine how they want to implement workflows related to this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For me, I ran into this issue when I started learning ArcObjects about six years ago, shortly after reading that page I just modified my workflows to use the Activator where needed and I haven't had to worry about this issue since then. Nowadays I use the Activator so much that I tend to forget that you can even use the new keyword.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2015 23:48:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/iworkspacefactorystatus-example/m-p/408366#M10942</guid>
      <dc:creator>FreddieGibson</dc:creator>
      <dc:date>2015-10-26T23:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: IWorkspaceFactoryStatus Example</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/iworkspacefactorystatus-example/m-p/408367#M10943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Domenico and Freddie,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see your point clearly. I will definitely use Activator.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I do not understand in my old project&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 13.3333px; line-height: 20px;"&gt; (in comparison with ESRI example)&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5;"&gt; - &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5;"&gt;How can I obtain all currently open workspaces&amp;nbsp; "from air"?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;How that "magic" happens?&lt;/P&gt;&lt;P&gt;See the code from my project here&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/167371"&gt;Reconnect to SDE by IWorkspaceFactoryStatus causes errors&lt;/A&gt; &lt;/P&gt;&lt;P&gt;See the ESRI help&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.arcgis.com/EN/sdk/10.0/ArcObjects_NET/componenthelp/index.html#/IWorkspaceStatus_Interface/002500000mrn000000/" title="http://help.arcgis.com/EN/sdk/10.0/ArcObjects_NET/componenthelp/index.html#/IWorkspaceStatus_Interface/002500000mrn000000/"&gt;ArcObjects 10 .NET SDK Help&lt;/A&gt;&lt;/P&gt;&lt;H4 class="dtH4" style="font-size: 1.5em; color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif; margin-bottom: 0.4em; margin-top: 1em; margin-left: -18px;"&gt;&amp;nbsp;&amp;nbsp; Remarks&lt;/H4&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana; font-size: 11.3333px;"&gt;The &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Verdana; font-size: 11.3333px;"&gt;&lt;STRONG&gt;I&lt;STRONG&gt;WorkspaceFactoryStatus::WorkspaceStatus&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Verdana; font-size: 11.3333px;"&gt; property returns an enumeration of &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Verdana; font-size: 11.3333px;"&gt;&lt;STRONG&gt;I&lt;STRONG&gt;WorkspaceStatus&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Verdana; font-size: 11.3333px;"&gt; objects for all currently open workspaces.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Oct 2015 00:19:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/iworkspacefactorystatus-example/m-p/408367#M10943</guid>
      <dc:creator>MarkMindlin</dc:creator>
      <dc:date>2015-10-27T00:19:54Z</dc:date>
    </item>
  </channel>
</rss>

