Mark Wills
Member
Hi,
I have a class that raises events. I want the TYPE of the parameter to be a user defined type. Then, in the event handler, intellisense would recognise the typed parameter... However, it isn't working...
In .Net 2.0 TYPES have gone, so I've had to use a structure instead... However I'm sure it no longer works as it used to...
Here's a section of my code:
Then, elsewhere (actually on my form) I consume the event advertised in the class:
Note: cls9900 is my class, tms9900 is an instance of cls9900
As shown above, when I type register, intellisense is not showing me the members of the type (structure) structTMS9900Register, which leads me to think there is something wrong with the way I've coded it...
Any ideas? In the "old" days (VB6 and I'm *sure* earlier versions of VB.Net) you simply defined a type, and referenced as the type of the parameter you were passing... Intellisense would pick it up.
I'm a bit confused! Help!
If I enter:
Select Case Register
Case Register.PC
Then I get error: Operator '=' is not defines for types cls9900.TMS9900.structTMS9900Register and Integer
Is this a clue?
Thanks
Mark
I have a class that raises events. I want the TYPE of the parameter to be a user defined type. Then, in the event handler, intellisense would recognise the typed parameter... However, it isn't working...
In .Net 2.0 TYPES have gone, so I've had to use a structure instead... However I'm sure it no longer works as it used to...
Here's a section of my code:
VB.NET:
Public Structure structTMS9900Register
Dim PC As Integer
Dim WP As Integer
Dim ST As Integer
Dim R0 As Integer
Dim R1 As Integer
Dim R2 As Integer
Dim R3 As Integer
Dim R4 As Integer
Dim R5 As Integer
Dim R6 As Integer
Dim R7 As Integer
Dim R8 As Integer
Dim R9 As Integer
Dim R10 As Integer
Dim R11 As Integer
Dim R12 As Integer
Dim R13 As Integer
Dim R14 As Integer
Dim R15 As Integer
End Structure
Public Event BreakpointAsserted(ByVal Register As structTMS9900Register, ByVal Asserted As Boolean)
... other code omitted...
Then, elsewhere (actually on my form) I consume the event advertised in the class:
VB.NET:
AddHandler tms9900.BreakpointAsserted, AddressOf BreakpointAsserted
Public Sub BreakpointAsserted(ByVal Register As cls9900.TMS9900.structTMS9900Register, ByVal Asserted As Boolean)
' breakpoint handler for break point assertions on address.
' Asserted=True causes the Breakpoint box to light up (white on red)
' Asserted=False restores normal colour
Select Case Register
Case <---- PROBLEM HERE
End Select
End Sub
Note: cls9900 is my class, tms9900 is an instance of cls9900
As shown above, when I type register, intellisense is not showing me the members of the type (structure) structTMS9900Register, which leads me to think there is something wrong with the way I've coded it...
Any ideas? In the "old" days (VB6 and I'm *sure* earlier versions of VB.Net) you simply defined a type, and referenced as the type of the parameter you were passing... Intellisense would pick it up.
I'm a bit confused! Help!
If I enter:
Select Case Register
Case Register.PC
Then I get error: Operator '=' is not defines for types cls9900.TMS9900.structTMS9900Register and Integer
Is this a clue?
Thanks
Mark