473,770 Members | 4,029 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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"(ByV al
hwndCaller As Integer, ByVal pszFile As String, ByVal uCommand As Integer,
ByRef dwData As Any) As Integer

Private Declare Function RegSetValueEx Lib "advapi32.d ll" 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.d ll" 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"(ByVa l 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 12554
"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
2874
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 Vainio http://www.students.tut.fi/~vainio24
68
4375
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 don't like the brackets.
27
5091
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 would just as soon place the employer in control of what directory he wishes to save it in, and there are two salient reasons for this: 1. I want him to OWN the document 2. I want him to FIND the document, quickly, on his hard drive In any...
28
3428
by: Act | last post by:
Why is it suggested to not define data members as "protected"? Thanks for help!
72
4232
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 c?
0
278
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 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
0
1573
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". Because there is so many unregular convertions in English then I think it will be a hard work if do it by myself. Thanks.
5
1801
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". Because there is so many unregular convertions in English then I think it will be a hard work if do it by myself. Thanks.
3
1888
by: 30knot | last post by:
is this possible in HTML? If so, what is the code? Thanks, Chris
0
9439
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10237
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10071
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9882
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8905
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6690
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3987
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3589
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.