VERSION 5.00 Begin {AC0714F6-3D04-11D1-AE7D-00A0C90F26F4} Connect ClientHeight = 9435 ClientLeft = 1740 ClientTop = 1545 ClientWidth = 9405 _ExtentX = 16589 _ExtentY = 16642 _Version = 393216 Description = "P4 COM Addin" DisplayName = "P4ComAddin" AppName = "Microsoft Project" AppVer = "Microsoft Project 9.0" LoadName = "Startup" LoadBehavior = 3 RegLocation = "HKEY_CURRENT_USER\Software\Microsoft\Office\MS Project" End Attribute VB_Name = "Connect" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True Option Explicit ' The global application object Dim m_App As Object ' Global variable we can save results to Dim m_p4interface As p4interface Private Sub AddinInstance_OnConnection(ByVal Application As Object, _ ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, _ ByVal AddInInst As Object, custom() As Variant) On Error GoTo Error_Block Dim t As Tracker: Set t = GStackTrace.Enter(TypeName(Me), "AddinInstance_OnConnection") ' Save app object and make sure we see events If ConnectMode = ext_cm_Startup Then If GStacker.Tracing Then Dim Msg As String Msg = "Version: " & DLLVersion() GStacker.TraceMsg Msg Msg = "COM Ver: " & COMDLLVersion() GStacker.TraceMsg Msg End If Set m_App = Application InitP4 AddInInst.PROGID m_p4interface.CreatePerforceMenu bStartup:=True End If Exit Sub Error_Block: t.Report End Sub Private Sub AddinInstance_OnDisconnection(ByVal RemoveMode As _ AddInDesignerObjects.ext_DisconnectMode, custom() As Variant) On Error GoTo Error_Block Dim t As Tracker: Set t = GStackTrace.Enter(TypeName(Me), "AddinInstance_OnDisconnection") m_p4interface.DeletePerforceMenu Set m_p4interface = Nothing Set m_App = Nothing err.Clear Exit Sub Error_Block: t.Report End Sub Private Sub InitP4(PROGID As String) ' Make sure we only have one copy of the class object!! If m_p4interface Is Nothing Then Set m_p4interface = New p4interface Set g_p4interface = m_p4interface If GStacker.Tracing Then Dim Msg As String Msg = "InitP4 - App: " & m_App.Name GStacker.TraceMsg Msg End If m_p4interface.Initialize m_App, PROGID End If End Sub