MarshallSoft DUN Dialer
Library for Delphi
Programmer's Manual
(MDD4D)
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 : info@marshallsoft.com
web : www.marshallsoft.com
MarshallSoft is a member of the Association of Shareware Professionals
MARSHALLSOFT is a registered trademark of MarshallSoft Computing.
1 Introduction
1.1 Documentation Set2 Compiler Issues
1.2 Example Program
1.3 Installation
1.4 Uninstalling
1.5 Ordering
1.6 Updates
2.1 Delphi Versions3 Example Programs
2.2 Compiling Programs
2.3 Key Codes
3.1 VER4 Revision History
3.2 DIAL
3.3 FLY
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:
Refer to http://www.marshallsoft.com/mdd4d.htm for the latest version of this software.
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:
The following example segment demonstrates the use of some of the library functions:
unit ver_pgm;
interface
uses
DisplayUnit, MDD, KeyCode,
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Menus;
type
TForm1 = class(TForm)
MainMenu1: TMainMenu;
PushMe1: TMenuItem;
Memo1: TMemo;
procedure PushMe1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.PushMe1Click(Sender: TObject);
var
Code : Integer;
Version : Integer;
Build : Integer;
D1, D2, D3 : Integer;
BuffPtr : PChar;
Text : String;
begin
{attach MDD}
Code := mddAttach(MDD_KEY_CODE);
if Code < 0 then
begin
Text := Format('Cannot attach MDD (error %d)',[Code]);
DisplayLine(Form1.Memo1, Text);
exit;
end;
GetMem(BuffPtr,50);
{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}
mddDebug(MDD_GET_REGISTRATION,BuffPtr,65);
Text := Format('%s',[BuffPtr]);
DisplayLine(Form1.Memo1, Text);
DisplayString(Form1.Memo1,'Click [X] to close.');
{all done}
FreeMem(BuffPtr, 50);
mddRelease;
end;
end.
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.
Note that the Windows registry is not modified by the install process.
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.
See the section "Ordering" in the MDD User's Manual (MDD_USR) for details on ordering.
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
http://www.marshallsoft.com/oem.htm
After one year, licenses can be updated for $30 for email delivery. Note that registered DLLs never expire.
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.
The first release of Borland Delphi (version 1) generated Win16 code. MDD32.DLL functions can not be called from Delphi 1.
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.
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.
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.
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.
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.
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.
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.
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.
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 http://www.marshallsoft.com/mdd4d.htm for the latest version of this software.