C
Christopher Pragash
Hello All,
I am trying to convert the ApplicationEX class from OpenNETCF Framework to
VB.NET (since my complete project is in VB.NET and we want consistency in
code language) - I translated all the code but I keep getting an error
"NotSupported" when a call is made to GetMessage inside the Pump function.
Here is my calling signature:
If GetMessage(msg, IntPtr.Zero, 0, 0) Then 'This line returns a
"NotSupported" Exception
My P/Invode Declerations and the msg Structrure are listed below. Any
thoughts or suggestions on this would be really helpful. Thanks in advance,
Chris
Following are my P/Invoke Decelerations:
<DllImport("coredll.dll", EntryPoint:="PeekMessage", SetLastError:=True)> _
Private Shared Function PeekMessage(ByVal lpMSG As msg, ByVal hWnd As
IntPtr, ByVal wMsgFilterMin As Integer, ByVal wMsgFilterMax As Integer,
ByVal wRemoveMsg As Integer) As Boolean
End Function
<DllImport("coredll.dll", EntryPoint:="GetMessageW", SetLastError:=True)> _
Private Shared Function GetMessage(ByVal lpMSG As msg, ByVal hWnd As IntPtr,
ByVal wMsgFilterMin As Integer, ByVal wMsgFilterMax As Integer) As Boolean
End Function
<DllImport("coredll.dll", EntryPoint:="TranslateMessage",
SetLastError:=True)> _
Private Shared Function TranslateMessage(ByVal lpMsg As msg) As Boolean
End Function
<DllImport("coredll.dll", EntryPoint:="DispatchMessage",
SetLastError:=True)> _
Private Shared Function DispatchMessage(ByVal lpMsg As msg) As Boolean
End Function
<DllImport("coredll.dll", EntryPoint:="PostQuitMessage",
SetLastError:=True)> _
Private Shared Sub PostQuitMessage(ByVal nExitCode As Integer)
End Sub
Following is my MSG Structure decleration
Public Structure MSG
Public hwnd As IntPtr
Public message As Integer
Public wParam As IntPtr
Public lParam As IntPtr
Public time As Integer
Public pt_x As Integer
Public pt_y As Integer
End Structure
I am trying to convert the ApplicationEX class from OpenNETCF Framework to
VB.NET (since my complete project is in VB.NET and we want consistency in
code language) - I translated all the code but I keep getting an error
"NotSupported" when a call is made to GetMessage inside the Pump function.
Here is my calling signature:
If GetMessage(msg, IntPtr.Zero, 0, 0) Then 'This line returns a
"NotSupported" Exception
My P/Invode Declerations and the msg Structrure are listed below. Any
thoughts or suggestions on this would be really helpful. Thanks in advance,
Chris
Following are my P/Invoke Decelerations:
<DllImport("coredll.dll", EntryPoint:="PeekMessage", SetLastError:=True)> _
Private Shared Function PeekMessage(ByVal lpMSG As msg, ByVal hWnd As
IntPtr, ByVal wMsgFilterMin As Integer, ByVal wMsgFilterMax As Integer,
ByVal wRemoveMsg As Integer) As Boolean
End Function
<DllImport("coredll.dll", EntryPoint:="GetMessageW", SetLastError:=True)> _
Private Shared Function GetMessage(ByVal lpMSG As msg, ByVal hWnd As IntPtr,
ByVal wMsgFilterMin As Integer, ByVal wMsgFilterMax As Integer) As Boolean
End Function
<DllImport("coredll.dll", EntryPoint:="TranslateMessage",
SetLastError:=True)> _
Private Shared Function TranslateMessage(ByVal lpMsg As msg) As Boolean
End Function
<DllImport("coredll.dll", EntryPoint:="DispatchMessage",
SetLastError:=True)> _
Private Shared Function DispatchMessage(ByVal lpMsg As msg) As Boolean
End Function
<DllImport("coredll.dll", EntryPoint:="PostQuitMessage",
SetLastError:=True)> _
Private Shared Sub PostQuitMessage(ByVal nExitCode As Integer)
End Sub
Following is my MSG Structure decleration
Public Structure MSG
Public hwnd As IntPtr
Public message As Integer
Public wParam As IntPtr
Public lParam As IntPtr
Public time As Integer
Public pt_x As Integer
Public pt_y As Integer
End Structure