troubleshooting Question

'AddressOf' expression cannot be converted to 'Integer' because 'Integer' is not a delegate type

Avatar of Delta526
Delta526 asked on
Visual Basic.NET
13 Comments1 Solution810 ViewsLast Modified:
This was marked in my code.
Public Function EnumCallback(ByVal Handle As Integer, ByRef wins() As WinLabel) As Integer
end function

Public Function ListWindows(ByRef wins() As WinLabel, Optional ByRef hwnd As Integer = 0) As Integer
Dim res As Integer
If hwnd Then
'UPGRADE_WARNING: Add a delegate for AddressOf EnumCallback
res = EnumChildWindows(hwnd, AddressOf EnumCallback, wins)
end if
end function

This is the ERROR
'AddressOf' expression cannot be converted to 'Integer' because 'Integer' is not a delegate type.
What is a delegate type and why is this a problem? EnumCallback is already an integer.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 13 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 13 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros