Hi,
After creating the extension, the following are the steps to get fire OnCreate event
1. Registering the extension (Hope you have registered)
2. Applying the extension (This is very important to get fire OnCreate/OnChange and OnDelete events)
To apply an extension to an existing class, obtain an exclusive schema lock, then call the IClassSchemaEdit.AlterClassExtensionCLSID method. This method can also be used to remove a class extension by providing null values as both parameters. See the following code example:
'Pass the objectclass(featureclass) for which the extension to be applied (for which the
'oncreate event to get fired on creation of features) and the class id of the class extension file
'you created and set nothing for third parameter
Public Sub ChangeClassExtension(ByVal objectClass As IObjectClass, ByVal extensionUID As String, ByVal extensionProperties As IPropertySet)
Dim schemaLock As ISchemaLock = CType(objectClass, ISchemaLock)
Try
' Attempt to get an exclusive schema lock.
schemaLock.ChangeSchemaLock(esriSchemaLock.esriExclusiveSchemaLock)
' Cast the object class to the IClassSchemaEdit2 interface.
Dim classSchemaEdit As IClassSchemaEdit = CType(objectClass, IClassSchemaEdit)
If Not extensionUID.Equals("") Then
' Create a unique identifier (UID) object and change the extension.
Dim extUID As UID = New UIDClass()
extUID.Value = extensionUID
classSchemaEdit.AlterClassExtensionCLSID(extUID, extensionProperties)
Else
' Clear the class extension.
classSchemaEdit.AlterClassExtensionCLSID(Nothing, Nothing)
End If
Catch comExc As COMException
Throw New Exception("Could not change class extension.", comExc)
Finally
schemaLock.ChangeSchemaLock(esriSchemaLock.esriSharedSchemaLock)
End Try
End Sub
Hope this helps you
Regards
Alagappan