Click here to Skip to main content
12,946,816 members (50,450 online)
Click here to Skip to main content
Add your own
alternative version

Stats

262.4K views
10.3K downloads
44 bookmarked
Posted 2 Dec 1999

Internet dialup program

, 2 Dec 1999
Rate this:
Please Sign up or sign in to vote.
A dial-up dialer for connection to Internet providers

Sample Image - afdialer.jpg

Introduction

I have written dial-up dialer for connection to Internet providers. This is a simple little program that dials your modem and tracks your online time. It also allows the user to setup multiple dial in numbers and gives the user a basic settings screen.

The sourcecode is freeware and can be distributed under terms of GPL. It is written in Visual C++ with use of MFC, RAS API and several other APIs like Performance Counters and multimedia API. Contact me if you have any suggestions on this software (lamer2000@hotmail.com) or on this article (alexander.fedorov@usa.net).

Latest update

The latest version of the project can be found here - http://win32utils.com/afd/

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Alexander Fedorov
Web Developer SEO
Russian Federation Russian Federation
AlexF's Blog in Russian
Owner Spy competition analysis
Rating Burner Rating of blogs

You may also be interested in...

Comments and Discussions

 
QuestionProgrmatically Creating New Modem Pin
Rangaraman12-Jul-12 3:33
memberRangaraman12-Jul-12 3:33 
GeneralMy vote of 5 Pin
r0ediPell1-Jul-10 16:29
memberr0ediPell1-Jul-10 16:29 
Questionwhat version of compiler was used. I've tried to compile under Version 7 and 8 of Visual Studio no luck Pin
ACPR4839-Apr-08 9:21
memberACPR4839-Apr-08 9:21 
Generalsolved: RasEnumEntries() working in W2k/XP (code attached) Pin
Frank Rysanek25-Sep-06 4:10
memberFrank Rysanek25-Sep-06 4:10 
Hello everyone,

the original code wrapped around RasEnumEntries() contained several bugs.
Specifically, it didn't properly distinguish the following:
1) RAS phonebook entry size, i.e. sizeof(struct ...)
2) RasEnumEntries() buffer size, i.e. the malloc() argument

buffer_size = entry_size * number_of_entries

Note that entry_size is passed into RasEnumEntries() via
entry->dwSize, whereas buffer size and number of entries
are passed in via the function prototype (by pointer).

The initial call to RasEnumEntries() will check entry->dwSize
and buffer size. It may report *two different* errors:
the entry size can be wrong, or the buffer can be too small
for all the entries. In either case, it will return the following:
1) the correct buffer size
2) the correct number of entries
via the arguments "passed by pointer" through the prototype.
Can't say if it also modifies the entry->dwSize - for the
second try, I'm setting it to buffer_size / number_of_entries,
just in case.

As a side note, the buffer size was originally initialized to
sizeof(DWORD), rather than sizeof(phonebook_entry) Smile | :)

The following code snippet should be obvious enough.
I've compiled that as a console proggie with gcc/mingw,
but the code should be fairly portable to MSVC.

(CodeProject's editing system seems to eat all empty lines - oh well...)

=========== SAMPLE CODE =============

bool GetPhonebookEntries()
{
   RASENTRYNAME* first_ras_entry; // really a buffer of [num_entries]
   DWORD buf_size, entry_size;
   DWORD num_entries = 1;
   DWORD retval;
   UINT  ndx;
   char  szMessage[256];
 
   entry_size = sizeof(RASENTRYNAME);
   buf_size = entry_size * num_entries;
   first_ras_entry = (LPRASENTRYNAME) new char[buf_size];
 
   // check for a malloc() failure
   if (NULL == first_ras_entry) return FALSE;
 
   // clear the whole buffer, rather than a single entry
   ZeroMemory(first_ras_entry, buf_size); // AKA bzero() or memset(0)
   first_ras_entry->dwSize = entry_size; // initialize the dwSize member
   retval = RasEnumEntries(NULL, NULL, first_ras_entry, &buf_size, &num_entries);
 
   if (
          (ERROR_BUFFER_TOO_SMALL == retval) // entry size OK, but too many entries
       || (ERROR_INVALID_SIZE == retval) // entry size wrong
      )
   {
      entry_size = buf_size / num_entries; // recalculate the correct entry size
      
      // reallocate the buffer:
      delete first_ras_entry;
      first_ras_entry = NULL;
      first_ras_entry = (LPRASENTRYNAME) new char[buf_size];
      
      if (NULL != first_ras_entry) // if buffer OK, try again
      {
         ZeroMemory(first_ras_entry, buf_size);
         first_ras_entry->dwSize = entry_size;
         retval = RasEnumEntries(NULL, NULL, first_ras_entry, &buf_size, &num_entries);
      }
      else
         retval = ERROR_NOT_ENOUGH_MEMORY;
   }
 
   if (0 != retval) // other error
   {
      long int tmp_retval;
      tmp_retval = RasGetErrorString((UINT)retval, szMessage, 256);
      if (0 == tmp_retval)
      {
         printf("%s\n", szMessage);
      }
      else
         printf("Couldn't get a verbose err. message. RasGetErrorString() = %ld", tmp_retval);
   }
 
   if (0 == num_entries)
   {
      delete first_ras_entry ;
      return FALSE;
   }
 
   if (0 == retval)  // No errors
   {
      for (ndx = 0; ndx < num_entries; ndx++)
      {
         printf("Found a RAS entry: %s\n", first_ras_entry[ndx].szEntryName);
      }
   }
 
   delete first_ras_entry;
   return TRUE;
}

GeneralRe: solved: RasEnumEntries() working in W2k/XP (code attached) Pin
Tamnn20-Dec-09 23:49
memberTamnn20-Dec-09 23:49 
GeneralRe: solved: RasEnumEntries() working in W2k/XP (code attached) Pin
Frank Rysanek21-Dec-09 5:10
memberFrank Rysanek21-Dec-09 5:10 
GeneralRe: solved: RasEnumEntries() working in W2k/XP (code attached) Pin
Tamnn23-Dec-09 5:04
memberTamnn23-Dec-09 5:04 
GeneralRe: solved: RasEnumEntries() working in W2k/XP (code attached) Pin
Frank Rysanek23-Dec-09 10:02
memberFrank Rysanek23-Dec-09 10:02 
GeneralPlease Help:Cannot find the phone book error Pin
zalmay31-Aug-05 21:37
memberzalmay31-Aug-05 21:37 
GeneralCannot find the phone book entry Pin
aquintaba22-Aug-05 0:14
memberaquintaba22-Aug-05 0:14 
GeneralBad Link Pin
Kevin.Xue17-Apr-05 23:01
memberKevin.Xue17-Apr-05 23:01 
GeneralRe: Bad Link Pin
Alexander Fedorov19-Apr-05 8:24
memberAlexander Fedorov19-Apr-05 8:24 
GeneralBad links Pin
Nishant S21-Mar-05 20:10
staffNishant S21-Mar-05 20:10 
GeneralRe: Bad links Pin
Alexander Fedorov19-Apr-05 8:24
memberAlexander Fedorov19-Apr-05 8:24 
GeneralSound effects Pin
Nguyen Van Thuan9-Sep-04 17:59
memberNguyen Van Thuan9-Sep-04 17:59 
QuestionWhat is the appropriate RASENTRYNAME structure to work on all windows? Pin
mfc_surfer18-Dec-03 1:53
membermfc_surfer18-Dec-03 1:53 
AnswerRe: What is the appropriate RASENTRYNAME structure to work on all windows? Pin
Aswathy K R28-Feb-06 4:32
memberAswathy K R28-Feb-06 4:32 
GeneralProblem in win98 Pin
no_body6925-Jun-03 1:59
memberno_body6925-Jun-03 1:59 
QuestionHow to get device ID Pin
guostong19-May-03 19:13
memberguostong19-May-03 19:13 
QuestionHow to decrease size Pin
Lara Suji10-Mar-03 19:15
sussLara Suji10-Mar-03 19:15 
GeneralNot working under Win 2K Pin
Paras27-Feb-03 21:34
memberParas27-Feb-03 21:34 
GeneralRe: Not working under Win 2K Pin
Alexander Fedorov28-Feb-03 1:04
memberAlexander Fedorov28-Feb-03 1:04 
QuestionWhere is the latest source code? Pin
Anonymous6-Nov-02 17:05
sussAnonymous6-Nov-02 17:05 
AnswerRe: Where is the latest source code? Pin
Alexander Fedorov7-Nov-02 4:42
memberAlexander Fedorov7-Nov-02 4:42 
GeneralHelp Pin
Aji Varghese25-Jul-02 18:43
sussAji Varghese25-Jul-02 18:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170518.1 | Last Updated 3 Dec 1999
Article Copyright 1999 by Alexander Fedorov
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid