Replacement for SendMessageAny??

  • Thread starter Thread starter Adam Maltby
  • Start date Start date
A

Adam Maltby

Hi,

Being fairly new to .net this may a dumb q but here goes...

I know As Any is not supported on declares any more...
What can I use in place of "As Any" or is there another way of doing this?

Cheers
Adam
 
Hi,

Tried that - thanks....

This is what I ended up with in declare when i put another line in to overload....

Public Declare Function SendMessageAny Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

Public Declare Function SendMessageAny Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal msg As Long, ByVal wParam As Long, ByVal lParam As String) As Integer

and it gives me an error saying Value of Type object.form1.RECT Cannot Be Converted to Long

Any Ideas?

Cheers
Adam
 
Adam Maltby said:
This is what I ended up with in declare when i put another line in to
overload....

Public Declare Function SendMessageAny Lib "user32" Alias
"SendMessageA" (ByVal hwnd As Long, ByVal msg As Long, ByVal wParam
As Long, ByVal lParam As Long) As Long

First, you should get to know the basic data types of VB6 and VB.Net! The
declarations are for VB6. In VB.Net, 32-Bit Integer is Integer or Int32 (and
16-Bit Integer is Short or Int16).
Second, handles like window handles should be passed as IntPtr, not as
Integer.
Public Declare Function SendMessageAny Lib "user32" Alias
"SendMessageA" (ByVal hwnd As Long, ByVal msg As Long, ByVal wParam
As Long, ByVal lParam As String) As Integer

and it gives me an error saying Value of Type object.form1.RECT
Cannot Be Converted to Long

If the functions expects a Rect, declare the argument as Rect.


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 
Back
Top