Not the same signature for an Event.

Tome`

Member
Joined
Jun 7, 2004
Messages
9
Always something, lol

Ok maybe someone would be kind enough to tell me why I get this error.

When entering the following code:



Private Sub Player1_PlayStateChange(ByVal NewState As Long) Handles Player1.PlayStateChange



I get the error:

Method Player1.PlayStateChange can not handle event ‘PlayStateChange’ because they do not have the same signature.



I am just trying to use the event PlayStateChange for a Media Player named Player1 in a .NET application. Of course the event works in Visual Basic 6., but not in .NET

As always all help is appreciated.
 

Paszt

Staff member
Joined
Jun 3, 2004
Messages
1,500
Location
Raleigh, NC - USA
Programming Experience
Beginner
Are you using the WMPLib (AxWMPLib)?
I'm just curious how what library you're using. This stuff sounds interesting.

If you're using the ActiveX component, the signature for the event PlayStateChange is as follows:
VB.NET:
Private Sub Player1_PlayStateChange(ByVal sender As Object, _
  ByVal e As AxWMPLib._WMPOCXEvents_PlayStateChangeEvent) _
  Handles Player1.PlayStateChange

The closest signature I found to the one you've shown is this:
VB.NET:
Public Event PlayStateChange(ByVal NewState As Integer) _
  As WMPLib._WMPOCXEvents_PlayStateChangeEventHandler
 

Tome`

Member
Joined
Jun 7, 2004
Messages
9
Paszt,

Wow, you certainly have been a great help, but tell me- the PlayStartChange is supposed to return the value NewState right?, but that value is not declared in that statement. So how would I get that value?

Thanks Tome
 
Top Bottom