472,371 Members | 1,512 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,371 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 12355
"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...
0
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
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...

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.