P
pavel.orehov
Private Delegate Function WndCallback _
(ByVal hw As Integer, _
ByVal uMsg As Integer, _
ByVal wParam As Integer, _
ByVal lParam As Integer) As Integer
Private Declare Function SetWindowLong Lib "USER32.DLL" Alias
"SetWindowLongA" _
(ByVal hwnd As Integer, _
ByVal nIndex As Integer, _
ByVal dwNewLong As WndCallback) As WndCallback
Private PrevWndPRoc As WndCallback
Public Sub RegisterFormForOrientationDetection(ByRef f As
System.Windows.Forms.Form)
PrevWndPRoc = SetWindowLong(f.Handle.ToInt32(), _
GWL_WNDPROC, _
BBB-> AddressOf WndProcWithRotationDetection)
End Sub
Hi,
I have converted the VB6 code to .NET according to microsoft.
The compilation is okey, but i get an exception in runtime on line BBB
that says:
Invalid function pointer 0xffff0557 was passed into the runtime to be
converted to a delegate. Passing in invalid function pointers to be
converted to delegates can cause crashes, corruption or data loss.
What i did wrong ?
Thanks,
Pavel.
(ByVal hw As Integer, _
ByVal uMsg As Integer, _
ByVal wParam As Integer, _
ByVal lParam As Integer) As Integer
Private Declare Function SetWindowLong Lib "USER32.DLL" Alias
"SetWindowLongA" _
(ByVal hwnd As Integer, _
ByVal nIndex As Integer, _
ByVal dwNewLong As WndCallback) As WndCallback
Private PrevWndPRoc As WndCallback
Public Sub RegisterFormForOrientationDetection(ByRef f As
System.Windows.Forms.Form)
PrevWndPRoc = SetWindowLong(f.Handle.ToInt32(), _
GWL_WNDPROC, _
BBB-> AddressOf WndProcWithRotationDetection)
End Sub
Hi,
I have converted the VB6 code to .NET according to microsoft.
The compilation is okey, but i get an exception in runtime on line BBB
that says:
Invalid function pointer 0xffff0557 was passed into the runtime to be
converted to a delegate. Passing in invalid function pointers to be
converted to delegates can cause crashes, corruption or data loss.
What i did wrong ?
Thanks,
Pavel.