473,385 Members | 1,753 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 3178
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

49
by: Ville Vainio | last post by:
I don't know if you have seen this before, but here goes: http://text.userlinux.com/white_paper.html There is a jab at Python, though, mentioning that Ruby is more "refined". -- Ville...
68
by: Marco Bubke | last post by:
Hi I have read some mail on the dev mailing list about PEP 318 and find the new Syntax really ugly. def foo(x, y): pass I call this foo(1, 2), this isn't really intuitive to me! Also I...
27
by: Curious Angel | last post by:
I have a resume in PDF format and I want anyone who LEFT-OR-RIGHT clicks the link to force the file to be saved, and in any event _not_ opened. Since the PDF will be in his cache in any event, I...
28
by: Act | last post by:
Why is it suggested to not define data members as "protected"? Thanks for help!
72
by: Paminu | last post by:
In math this expression: (a < b) && (b < c) would be described as: a < b < c But why is it that in C these two expressions evaluate to something different for the same values of a, b and...
2
by: Lance Geeck | last post by:
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...
0
by: ZSP747 | last post by:
Now,I prepare to write a English-Chinese dictionary.So I want find a function or library can convert the words from one form to another,such as "boys"->"boy","became->become","went"->"go"....
5
by: ZSP747 | last post by:
Now,I prepare to write a English-Chinese dictionary. So I want find a function or library can convert the words from one form to another,such as "boys"->"boy","became->become","went"->"go"....
3
by: 30knot | last post by:
is this possible in HTML? If so, what is the code? Thanks, Chris
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.