Professional Documents
Culture Documents
Imports System.Runtime.InteropServices
Imports Microsoft.Win32
Namespace InventorAddIn2
<ProgIdAttribute("InventorAddIn2.StandardAddInServer"),
GuidAttribute("230cac1d-5709-4684-817a-5f95cf1ab8ee")>
Public Class StandardAddInServer
Implements Inventor.ApplicationAddInServer
' This method is called by Inventor when it loads the AddIn. The
AddInSiteObject provides access
' to the Inventor Application object. The FirstTime flag indicates if the
AddIn is loaded for
' the first time. However, with the introduction of the ribbon this
argument is always true.
Public Sub Activate(ByVal addInSiteObject As Inventor.ApplicationAddInSite,
ByVal firstTime As Boolean) Implements Inventor.ApplicationAddInServer.Activate
' Initialize AddIn members.
g_inventorApplication = addInSiteObject.Application
' This method is called by Inventor when the AddIn is unloaded. The AddIn
will be
' unloaded either manually by the user or when the Inventor session is
terminated.
Public Sub Deactivate() Implements
Inventor.ApplicationAddInServer.Deactivate
' This property is provided to allow the AddIn to expose an API of its own
to other
' programs. Typically, this would be done by implementing the AddIn's API
' interface in a class and returning that class object through this
property.
Public ReadOnly Property Automation() As Object Implements
Inventor.ApplicationAddInServer.Automation
Get
Return Nothing
End Get
End Property
#End Region
End Class
End Namespace
Return guid
End Function
#End Region
'Picture Types
Public Const PICTYPE_BITMAP As Short = 1
Public Const PICTYPE_ICON As Short = 3
<StructLayout(LayoutKind.Sequential)>
Public Class Icon
Friend cbSizeOfStruct As Integer =
Marshal.SizeOf(GetType(PICTDESC.Icon))
Friend picType As Integer = PICTDESC.PICTYPE_ICON
Friend hicon As IntPtr = IntPtr.Zero
Friend unused1 As Integer
Friend unused2 As Integer
<StructLayout(LayoutKind.Sequential)>
Public Class Bitmap
Friend cbSizeOfStruct As Integer =
Marshal.SizeOf(GetType(PICTDESC.Bitmap))
Friend picType As Integer = PICTDESC.PICTYPE_BITMAP
Friend hbitmap As IntPtr = IntPtr.Zero
Friend hpal As IntPtr = IntPtr.Zero
Friend unused As Integer
End Module