AppRot in ArcGis 10 is Nothing, VB

358
2
03-14-2011 07:39 AM
NicholasNekhoroshev1
New Contributor
I have a dll in VB, where do I get access to AppRot (ArcGis 10):

Dim pAppRoot As AppROT
Set pAppRoot = New AppROT

Now when I call the DLL from VBA, it works great.
If I call the DLL from a separate application for C + +, then pAppRot is Nothing. In Previous versions Of ArcGis everything is working fine. How can I fix it?
0 Kudos
2 Replies
MichaelRobb
Occasional Contributor III
I have a dll in VB, where do I get access to AppRot (ArcGis 10):

Dim pAppRoot As AppROT
Set pAppRoot = New AppROT

Now when I call the DLL from VBA, it works great.
If I call the DLL from a separate application for C + +, then pAppRot is Nothing. In Previous versions Of ArcGis everything is working fine. How can I fix it?


Do you have a Count?
pAppRoot.count  is?

I usually do this:
If m_appROT.Count > 0 Then
            For q = 0 To m_appROT.Count - 1
                'If TypeOf m_appROT.Item(i) Is IGxApplication Then ' ArcCatalog running

                If TypeOf m_appROT.Item(q) Is IMxApplication Then ' ArcMap running
                    If m_appROT.Item(q).Visible = True Then
                        If m_appROT.Item(q).Document.Title = lblConnectedTo.Text Then
                            pApp = m_appROT.Item(q) ' The session originally used.
                        End If
                    End If

                End If
            Next q
        End If
0 Kudos
NicholasNekhoroshev1
New Contributor
Do you have a Count?
pAppRoot.count  is?

I usually do this:
If m_appROT.Count > 0 Then
            For q = 0 To m_appROT.Count - 1
                'If TypeOf m_appROT.Item(i) Is IGxApplication Then ' ArcCatalog running

                If TypeOf m_appROT.Item(q) Is IMxApplication Then ' ArcMap running
                    If m_appROT.Item(q).Visible = True Then
                        If m_appROT.Item(q).Document.Title = lblConnectedTo.Text Then
                            pApp = m_appROT.Item(q) ' The session originally used.
                        End If
                    End If

                End If
            Next q
        End If


I have a running ArcMap. There is no property COunt, because pAppRot is Nothing = TRUE.
0 Kudos