how to convert this vb6 into vb net
it has en error on addressof
vb.net Code:
m_lngPreviousValue = SetWindowLong(p_lngWindowHandle, GWL_WNDPROC, AddressOf WindowProc)
Printable View
how to convert this vb6 into vb net
it has en error on addressof
vb.net Code:
m_lngPreviousValue = SetWindowLong(p_lngWindowHandle, GWL_WNDPROC, AddressOf WindowProc)
what error exactly ?
it also says here that you should now use SetWindowLongPtr.
The error is not in the code you have posted, but rather in your declaration of SetWindowLong. You are no doubt using a VB6 declaration where the last parameter is declared as a number. In VB.NET AddressOf returns a delegate so you must declare that parameter as an appropriate delegate type. You should serahc for a VB.NET declaration for that function. Try PInvoke.net first.