469,921 Members | 2,176 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,921 developers. It's quick & easy.

Declare Function and "As Any"

I have many items that I lifted off from Microsoft's website several years
ago. These samples were in VB6.

I now want to convert an application to VB.NET. I am getting an error
that says "As Any is not supported in a declare statement" during the
automated
Conversion process.

Some examples of this are:
Private Declare Sub CopyMem Lib "kernel32" Alias "RtlMoveMemory"(ByRef
Destination As Any, ByRef Source As Any, ByVal Length As Integer)
Declare Function HTMLHelp Lib "hhctrl.ocx" Alias "HtmlHelpA"(ByVal
hwndCaller As Integer, ByVal pszFile As String, ByVal uCommand As Integer,
ByRef dwData As Any) As Integer

Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias
"RegSetValueExA"(ByVal hKey As Integer, ByVal lpValueName As String, ByVal
Reserved As Integer, ByVal dwType As Integer, ByRef lpData As Any, ByVal
cbData As Integer) As Integer

Private Declare Function RegEnumValue Lib "advapi32.dll" Alias
"RegEnumValueA"(ByVal hKey As Integer, ByVal dwIndex As Integer, ByVal
lpValueName As String, ByRef lpcbValueName As Integer, ByVal lpReserved As
Integer, ByRef lpType As Integer, ByRef lpData As Any, ByRef lpcbData As
Integer) As Integer

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA"(ByVal
hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal
lParam As Any) As Integer

Private Declare Function OSWinHelp Lib "user32" Alias "WinHelpA"(ByVal hwnd
As Integer, ByVal HelpFile As String, ByVal wCommand As Short, ByRef dwData
As Any) As Short Const EM_UNDO As Short = &HC7s

I'm sure I can't be the only person to come accross this. Is there a list
of these common calls someplace that tells me the proper values to replace
the "As Any" with?
Nov 20 '05 #1
2 12174
"Lance Geeck" <lg****@cox.net> schrieb
I have many items that I lifted off from Microsoft's website several
years ago. These samples were in VB6.

I now want to convert an application to VB.NET. I am getting an
error that says "As Any is not supported in a declare statement"
during the automated
Conversion process.

Some examples of this are:
[...]


Replace As Any by another data type. You can overload declarations to use
different types.

See also
http://msdn.microsoft.com/library/en...indowsAPIs.asp
and the linked topics, like
http://msdn.microsoft.com/library/en...lfunctions.asp
and
http://msdn.microsoft.com/library/en...marshaling.asp

Be careful when strings are returned byref: Use a stringbuilder instead.

--
Armin

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

Nov 20 '05 #2
"Lance Geeck" <lg****@cox.net> schrieb
I have many items that I lifted off from Microsoft's website several
years ago. These samples were in VB6.

I now want to convert an application to VB.NET. I am getting an
error that says "As Any is not supported in a declare statement"
during the automated
Conversion process.

Some examples of this are:
[...]


Replace As Any by another data type. You can overload declarations to use
different types.

See also
http://msdn.microsoft.com/library/en...indowsAPIs.asp
and the linked topics, like
http://msdn.microsoft.com/library/en...lfunctions.asp
and
http://msdn.microsoft.com/library/en...marshaling.asp

Be careful when strings are returned byref: Use a stringbuilder instead.

--
Armin

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

Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

68 posts views Thread by Marco Bubke | last post: by
28 posts views Thread by Act | last post: by
reply views Thread by Lance Geeck | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.