Answered Windows API question

GendoIkari

Member
Joined
Mar 20, 2009
Messages
20
Programming Experience
1-3
I'm upgrading some old VB6 code, and it uses a lot of Windows API function declarations. Most of them have an "A" at the end of the function name, such as "GetFileVersionInfoA." When I look up these functions in API documentation, it seems that the name of the functions do not have an "A" at the end, such as "GetFileVersionInfo."

Are GetFileVersionInfoA and GetFileVersionInfo 2 different functions? What does the "A" mean? Thanks.
 
Last edited:
internet said:
If a Windows API function deals with "character data," which means it either returns character data (or a pointer to it) or has any character parameter, the Windows API will most often provide you with two functions: an ANSI version and a Unicode version. These will be designated by a functionname suffix of "A" (ansi) for the ASCII version and "W" (wide) for the Unicode version.
In most cases one Declare the name without such encoding symbols and define an Alias to the actual A/W function.

The ApiViewer 2004 app found here: ActiveVB - ApiViewer (en) is helpful for getting approx declarations for API functions etc for VB.Net. (configure language syntax in Options)
So is this site: pinvoke.net: the interop wiki!

Also beware that the .Net Framework library have a lot of functionality now managed that in VB6 days one had to use Windows API functions to do. Straight upgrades/conversion from VB6 is often less beneficial than learning .Net and rewriting the app/lib.
 
Thank you. Believe me, if it were up to me, I'd be getting rid of probably all the API calls, but our client wants to get this into .Net with as little changes as possible.
 
Back
Top