The information in the following topics mainly pertains to using RASAPI functions from VB, although a few other approaches are also included. Only the RAS api functions that can be used across windows platforms have been included here.
The RASAPI is the backbone to dial-up networking on windows NT, 2000, 95 and 98. The main problem with using the RASAPI functions is that the structures are often a different size for each windows platform. One approach to this problem is to use a wrapper structure that fills or is filled by a platform specific structure , using the GetVersionEx api to determine the windows platform.
I personally don't like that approach because it means you have up to five different structures defined just for the one structure that is really needed, and, although currently a valid approach, by using the GetVersionEx api that method relies on the windows platform not the RASAPI version, which may in the future cause problems should updated RASAPI's be released for earlier windows versions.
The approach I have taken is to use an array of bytes for the given structure, and pass that to the function. Hence my code makes extensive use of the copymemory api. Some of the RASAPI functions will tell us the appropriate size of the structure, others will return errors till we get it right.
Also I have included a section on getting dial-up networking statistics. I have not seen this documented anywhere else.
If you find any errors, or have any comments, please email me.
NOTE: All the information here is protected under international copyright laws. You may use this information to write code for your VB applications, BUT you may NOT distribute, reprint or publish any of this information without my prior consent. This is to stop the proliferation of "modified" versions of my approach, and/or out-dated information being circulated should I update these pages.
See Also: Contents