Partager via


AutoDial-Compatible Dialers (Windows Embedded CE 6.0)

1/6/2010

An AutoDial-compatible dialer is an application that communicates with the AutoDial DLL. AutoDial expects information about the dialer to be located at the following registry key:

HKEY_LOCAL_MACHINE\Comm\Autoras
    Dialer = Rnaapp.exe
    NoPromptOpt = -p
    RasEntryOpt = -e

As in this example, the Dialer entry contains the name of the executable file of the dialer. The NoPromptOpt entry defines the argument that AutoDial will use to inform the dialer at launch time not to prompt the user for anything. The RasEntryOpt defines the argument that AutoDial will use to inform the dialer at launch time which phone-book entry to dial.

AutoDial passes messages to the dialer through a message queue that the dialer must create using CreateMsgQueue. The dialer should pass AUTORAS_MSGQUEUE_NAME as the name of the message queue, set the options to write access, and set the MSGQUEUE_ALLOW_BROKEN flag.

At the current time, AutoDial recognizes only two messages: DIALER_START and DIALER_TERMINATE. More messages may be added in the future.

Sample code for a working dialer application is provided for you in this SDK. Go to the %_WINCEROOT%\Public\Common\Oak\Drivers\Netsamp\Rnaapp directory to view the code. The following examples were taken from the Rnaapp.c file.

Setting up the Message Queue

The following sample shows how to set up the message queue.

// RNAAPP as autodialer for AutoRas needs to send feedback
// to Autoas through message queue.
sOptions.dwSize         = sizeof(MSGQUEUEOPTIONS);
sOptions.dwFlags        = MSGQUEUE_ALLOW_BROKEN;
sOptions.dwMaxMessages  = 8;
sOptions.cbMaxMessage   = sizeof(DIALER_NOTIFICATION);
sOptions.bReadAccess    = FALSE;
g_hMsgQueue = CreateMsgQueue(AUTORAS_MSGQUEUE_NAME, &sOptions);

if (g_hMsgQueue == NULL)
{
   DEBUGMSG(ZONE_ERROR,
      (TEXT("RNAAPP:: Failed CreateMsgQueue..\r\n")));
}
else
{
   //
   // Autoras is at the other side, send DIALER_START to it.
   //
   g_DialerNotification.dwNotificationId = DIALER_START;

   WriteMsgQueue(
      g_hMsgQueue,
      &g_DialerNotification,
      sizeof(DIALER_NOTIFICATION),
      0x00,
      0x00);
}

Terminating the Dialer

The following sample shows how to terminate the dialer.

if (g_hMsgQueue)
   {
      g_DialerNotification.dwNotificationId = DIALER_TERMINATE;

      WriteMsgQueue(
         g_hMsgQueue,
         &g_DialerNotification,
         sizeof(DIALER_NOTIFICATION),
         0x00,
         0x00);

      CloseMsgQueue(g_hMsgQueue);
   }

See Also

Concepts

RAS AutoDial