MarshallSoft DUN Dialer

Library for Delphi

Programmer's Manual


Version 2.1

July 5, 2002

This software is provided as-is.
There are no warranties, expressed or implied.

Copyright (C) 2002
All rights reserved

MarshallSoft Computing, Inc.
Post Office Box 4543
Huntsville AL 35815

Voice : 1-256-881-4630

FAX : 1-256-880-0925

email :

web :

MarshallSoft is a member of the Association of Shareware Professionals

MARSHALLSOFT is a registered trademark of MarshallSoft Computing.


1 Introduction
1.1 Documentation Set
1.2 Example Program
1.3 Installation
1.4 Uninstalling
1.5 Ordering
1.6 Updates
2 Compiler Issues
2.1 Delphi Versions
2.2 Compiling Programs
2.3 Key Codes
3 Example Programs
3.1 VER
3.2 DIAL
3.3 FLY
4 Revision History

1 Introduction

The MarshallSoft DUN Dialer (MDD) is a library of functions that allows your Win32 Delphi application program to dial up a local ISP (Internet Service Provider) using any existing DUN (Dialup Network) connection.

See Section 3.0 for details on the example programs.

MDD4D supports all versions of 32-bit Delphi.

MDD4D can be used with Windows 95/98/NT/Me/2000/XP. The MDD4D DLL (MDD32.DLL) can also be used from any Win32 application (C/C++, VB, etc.) capable of calling the Windows API.

When comparing MDD against our competition, note that:

  1. MDD4D is a standard Windows DLL (NOT an OCX or ActiveX control) and is much smaller than a comparable OCX or ActiveX control.
  2. MDD4D does NOT depend on ActiveX or Microsoft Foundation Class (MFC) libraries or similar "support" libraries.
  3. The MDD4D functions can be called from applications not capable of using controls.

Refer to for the latest version of this software.

1.1 Documentation Set

The complete set of documentation consists of three manuals in three formats. This is the first manual (MDD4D) in the set.

Each manual comes in three formats:

1.2 Example Program

The following example segment demonstrates the use of some of the library functions:

     unit ver_pgm;
       DisplayUnit, MDD, KeyCode,
       Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
       StdCtrls, Menus;
       TForm1 = class(TForm)
         MainMenu1: TMainMenu;
         PushMe1: TMenuItem;
         Memo1: TMemo;
         procedure PushMe1Click(Sender: TObject);
         { Private declarations }
         { Public declarations }
       Form1: TForm1;
     {$R *.DFM}

     procedure TForm1.PushMe1Click(Sender: TObject);
       Code : Integer;
       Version : Integer;
       Build : Integer;
       D1, D2, D3 : Integer;
       BuffPtr : PChar;
       Text : String;
       {attach MDD}
       Code := mddAttach(MDD_KEY_CODE);
       if Code < 0 then
           Text := Format('Cannot attach MDD (error %d)',[Code]);
           DisplayLine(Form1.Memo1, Text);
       {show version and build #}
       Version := mddDebug(MDD_GET_VERSION,BuffPtr,50);
       Build := mddDebug(MDD_GET_BUILD,BuffPtr,50);
       D3 := $0F AND Version;  Version := Version SHR 4;
       D2 := $0F AND Version;  Version := Version SHR 4;
       D1 := $0F AND Version;
       Text := Format('MDD32 Version:  %1d.%1d.%1d Build %d', [D1,D2,D3,Build]);
       DisplayLine(Form1.Memo1, Text);
       {show registration}
       Text := Format('%s',[BuffPtr]);
       DisplayLine(Form1.Memo1, Text);
       DisplayString(Form1.Memo1,'Click [X] to close.');
       {all done}
       FreeMem(BuffPtr, 50);

In the example program above, mddAttach is called to initialize MDD, and then mddDebug is called to get the version, build, and registration strings. Lastly, mddRelease is called to perform MDD termination processing and release the Winsock.

1.3 Installation

  1. Before installation of MDD4D, your 32-bit Delphi compiler (version 2 or above) should already be installed on your system and tested.

  2. Unzip MDD4D21.ZIP (or MDDxxxx.ZIP where xxxx is your Customer ID) using PKUNZIP, WINZIP, or PKZIP for Windows.

  1. Run the WISE installation program SETUP.EXE which will install all MDD4D files, including copying MDD32.DLL to your Windows directory. No Windows system files are modified.

  2. Load VER_PRJ.DPR, compile ands run.

Note that the Windows registry is not modified by the install process.

1.4 Uninstalling

Uninstalling MDD4D is very easy. MDD does not modify the registry.

First, run UINSTALL.BAT, which will delete MDD32.DLL from your Windows directory, typically C:\WINDOWS for Windows 95/98/Me/XP or C:\WINNT for Windows NT/2000.

Second, delete the MDD project directory created when installing MDD4D.

1.5 Ordering

See the section "Ordering" in the MDD User's Manual (MDD_USR) for details on ordering.

1.6 Updates

When you register MDD4D you will receive a set of registered DLLs plus a license file (MDDxxxx.LIC) that can be used to update your registered DLL's for a period of one year from purchase. Updates can be downloaded from

After one year, licenses can be updated for $30 for email delivery. Note that registered DLLs never expire.

2 Compiler Issues

2.1 Delphi Versions

Applications written with Delphi link with the same identical DLL's as for applications written in all other supported languages, such as C/C++ and Visual Basic.

2.1.1 Delphi 1

The first release of Borland Delphi (version 1) generated Win16 code. MDD32.DLL functions can not be called from Delphi 1.

2.1.2 Delphi 2

Delphi version 2 and above generates Win32 code. Therefore, applications written using Delphi 2 will link with MDD32.DLL. Strings can be much larger than 255 bytes.

Delphi 2 seems to have a problem with some of the string functions. Although the default is "large strings", some of the string functions (such as StrPas) copy only 255 bytes.

2.1.3 Delphi 3 and above.

There are no known Delphi problems impacting our example programs in Delphi version 3 and above. Applications written using Delphi 3 and above will link with MDD32.DLL.

2.2 Compiling Programs

The example programs are compiled from the Delphi development environment using the provided Delphi project files (*.DPR).

See section 3.0 "Example Programs" for more details on each of the example programs.

2.3 Key Codes

MDD32.DLL has a keycode encoded within it. Your keycode is a 9 or 10 digit decimal number (unless it is 0), and will be found in the file KEYCODE.PAS. The keycode for the shareware version is 0. You will receive a new key code when registering.

If you get an error message (value -74) when calling mddAttach, it means that the keycode in your application does not match the keycode in the DLL. After registering, it is best to remove the shareware version of MDD32.DLL from the Windows search path. Note that your keycode is NOT the same as your Customer ID/Registration ID.

3 Example Programs

Each of the following example programs uses the "display" unit and the "MDD" unit:

     DISPLAY.PAS   : Display unit source code.
     MDD32.PAS     : MDD Unit source code.

The DISPLAY.PAS unit is used to display text in Delphi memos.  DISPLAY.PAS contains 3 procedures:

     DisplayChar   : Displays character.
     DisplayString : Displays string.
     DisplayLine   : Displays line.

3.1 VER

The VER_PRJ (MDD Version) program should be the first example program that you compile and run. It displays the MDD version, build, and registration string. If you get the error "...wrong key", then you are not passing the correct keycode to mddAttach. Refer to Section 2.3 " Key Codes" for more information on key codes.

Open the Delphi Project File VER_PRJ.DPR.

3.2 DIAL

The DIAL example program demonstrates how to use DUN (Dialup Networking) to dial up an ISP (Internet Service Provider). After starting DIAL, the first five DUN connections will be displayed.

Open the Delphi Project File DIAL_PRJ.DPR.

3.3 FLY

The FLY example program operates like DIAL except that DUN parameters (user, password, and phone) are specified by the user at runtime ("on the fly").

Open the Delphi Project File FLY_PRJ.DPR.

4 Revision History

The MarshallSoft DUN Dialer (MDD32.DLL) is written in ANSI C. All language versions of MDD (C/C++, Delphi, Visual Basic, PowerBASIC, FoxPro, dBase, Xbase++) use the same MDD32.DLL.

Version 2.1: July 5, 2002.

Refer to for the latest version of this software.