talbertc42

Problem converting add-in to stand alone console application.

Discussion created by talbertc42 on Jul 5, 2012
Latest reply on Jul 6, 2012 by talbertc42
Hello all,
    I have an ArcCatalog add-in that I would like to convert to a console application but am stuck.  The add-in does some stuff to the selected dataset in the table of contents when a user clicks the button.  I would like the console application to do the exact same stuff to a dataset specified by a full path which will be passed into the application as a comand line parameter.

In my add-in I get the selected IGxObject easily with the following code:
        Dim pGxObject As IGxObject
        pGxObject = m_app.SelectedObject

        Dim pGxDataset As IGxDataset
        Try
            pGxDataset = pGxObject
        Catch ex As Exception
        End Try

In my console version of the application I don't know to create an m_app because I don't have the hook.
        m_app = CType(Hook, ESRI.ArcGIS.CatalogUI.IGxApplication)


Any tricks for creating an IGxDataset or IGxObject with only a path?
The only thing I can think of is using approt to open a new or existing ArcCatalog instance and generating it from there but I'd rather not do this if possible.
Thanks,
Colin

Outcomes