<p>we are writing tests for a COM library written in VB 6.0.The problem we are facing is that, we are unable to access events declared in VB( withevents). We get exception, "object does not support set of events". How can we overcome this problem?</p>

For example, we have a class in VB 6.0 called DatabaseCommand.
```
```
Option Explicit

Public Event SavedSuccessfully()

Public Sub Execute(ByVal vAge As Integer, ByVal vName As String, ByVal vAddress As String)

    RaiseEvent SavedSuccessfully

End Sub
```
```
Now, personclass
```
```
Private WithEvents dbCommand As DatabaseCommand

Public Sub Init(ByVal vDBCommand As DatabaseCommand)

    Set dbCommand = vDBCommand

End Sub

Private Sub dbCommand_SavedSuccessfully()
    'not implemented
End Sub
```
```
Now, when try to test this ( after compiling the vb project)
```
```
MockRepository repository = new MockRepository();

PersonLib.DatabaseCommand db = repository.DynamicMock<PersonLib.DatabaseCommand>();

PersonLib.PersonClass person = new PersonLib.PersonClass();

person.Init(db);  --- this line throws error - Object or class does not support the set of events
```
```