Alias 
Author Message
 Alias

I am new to Win API programming and was wondering what the purpose of the
Alias portion of the following statement is?

Private Declare Function WNetAddConnection3 Lib "mpr.dll" _
 Alias "WNetAddConnection3A" (ByVal hwnd as Long, lpNetResource As
NETRESOURCE, _
 ByVal lpPassword as String, ByVal lpUserName As String, ByVal dwFlags As
Long) As Long

Also, are there one or two Win API internet sites that provide some basic
information for the newcomer to API programming?

Thanks in advance for the information.
--
Dave Scott
====================================================================
If responding by email, remove "spamfree." from my address



Sat, 28 Jun 2003 02:02:45 GMT  
 Alias
AFAIK, this is there to enable you to declare a procedure by one name while
actually calling another....
Something like...

Private Declare Function AddConn Lib "mpr.dll" _
 Alias "WNetAddConnection3A" (ByVal hwnd as Long, lpNetResource As
NETRESOURCE, _
 ByVal lpPassword as String, ByVal lpUserName As String, ByVal dwFlags As
Long) As Long

When you call "AddConn", VB will actually call "WNetAddConnection3A"


Quote:
> I am new to Win API programming and was wondering what the purpose of the
> Alias portion of the following statement is?

> Private Declare Function WNetAddConnection3 Lib "mpr.dll" _
>  Alias "WNetAddConnection3A" (ByVal hwnd as Long, lpNetResource As
> NETRESOURCE, _
>  ByVal lpPassword as String, ByVal lpUserName As String, ByVal dwFlags As
> Long) As Long

> Also, are there one or two Win API internet sites that provide some basic
> information for the newcomer to API programming?

> Thanks in advance for the information.
> --
> Dave Scott
> ====================================================================
> If responding by email, remove "spamfree." from my address



Sat, 28 Jun 2003 04:50:03 GMT  
 Alias

Quote:

> I am new to Win API programming and was wondering what the purpose of the
> Alias portion of the following statement is?

> Private Declare Function WNetAddConnection3 Lib "mpr.dll" _
>  Alias "WNetAddConnection3A" (ByVal hwnd as Long, lpNetResource As
> NETRESOURCE, _
>  ByVal lpPassword as String, ByVal lpUserName As String, ByVal dwFlags As
> Long) As Long

"WNetAddConnection3" is the name your program sees.
"WNetAddConnection3A" is how the function is exported from mpr.dll.

In this particular case, the reason for this is that there are two
versions of the function, one ANSI and one Unicode.  Other reasons
to use Alias are that you don't like the name exported by the library
(or want to organize your imports), or the functions are exported in
a decorated form (which typically won't be a legal VB function name,



Sat, 28 Jun 2003 04:23:33 GMT  
 Alias
to answer the other part of your question:

www.allapi.com
www.vbapi.com


Quote:
> I am new to Win API programming and was wondering what the purpose of the
> Alias portion of the following statement is?

> Private Declare Function WNetAddConnection3 Lib "mpr.dll" _
>  Alias "WNetAddConnection3A" (ByVal hwnd as Long, lpNetResource As
> NETRESOURCE, _
>  ByVal lpPassword as String, ByVal lpUserName As String, ByVal dwFlags As
> Long) As Long

> Also, are there one or two Win API internet sites that provide some basic
> information for the newcomer to API programming?

> Thanks in advance for the information.
> --
> Dave Scott
> ====================================================================
> If responding by email, remove "spamfree." from my address



Sat, 28 Jun 2003 05:30:30 GMT  
 Alias
make that www.allapi.net (not .com)

--
Hope this helps ...

Rene Whitworth
Whitworth Software Solutions - Germany
http://www.w-s-s.de
Please reply to the newsgroup :-)



Quote:
> to answer the other part of your question:

> www.allapi.com
> www.vbapi.com



> > I am new to Win API programming and was wondering what the purpose of
the
> > Alias portion of the following statement is?

> > Private Declare Function WNetAddConnection3 Lib "mpr.dll" _
> >  Alias "WNetAddConnection3A" (ByVal hwnd as Long, lpNetResource As
> > NETRESOURCE, _
> >  ByVal lpPassword as String, ByVal lpUserName As String, ByVal dwFlags
As
> > Long) As Long

> > Also, are there one or two Win API internet sites that provide some
basic
> > information for the newcomer to API programming?

> > Thanks in advance for the information.
> > --
> > Dave Scott
> > ====================================================================
> > If responding by email, remove "spamfree." from my address



Sun, 29 Jun 2003 16:22:53 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Alias in msaccess.exe gone??

2. Dos Alias in CurrentDb.name

3. msaccess.exe aliases

4. 32 bit API call not recognizing Alias Name

5. using MS Exchange alias

6. Having trouble getting the Alias (Account) field data from a global address

7. How to create a shortcut or alias to the document upon saving the document

8. Styles defined in VBA lose their shortcuts (aliases) - but not always

9. Styles defined in VBA lose their shortcuts (aliases) - but not always - addendum

10. Using Namespace Aliases in VB.NET and coding guidelines

11. SQL Alias

12. How to map an ALIAS in htmlhelp ?

 

 
Powered by phpBB® Forum Software