Академический Документы
Профессиональный Документы
Культура Документы
com/print/29297
Abstract: Depending on what you do within your application, if you use one or more ClientDataSets
you may need to deploy one or more libraries, in addition to your application's executable. This
article describeswhen and how.
I've discussed a number of ClientDataSet topics in the articles that have appeared in this series, but I
have not said much about how to deploy applications that use ClientDataSets. Now that I think about
it, this is a topic that I should have covered earlier, but as the old saying goes, better late than never.
The fact is, if you include even one ClientDataSet in your application, you need to take at least one
additional step in order to deploy that application to another machine. Fortunately, the step is pretty
simple. You either have to deploy an additional library with your application, or you have to manually
add the MidasLib unit to your project's uses clause.
To best understand this, let's create a simple application that includes a ClientDataSet, and then look
at the modules that get loaded when you run it. Use the following steps:
1 of 6 20.11.2008 17:24
Deploying Applications that use ClientDataSets http://dn.codegear.com/print/29297
If your Modules window is empty, your integrated debugger is probably disabled. Select Tools |
Debugger Options, and then enable the Integrated Debugger checkbox to turn your integrated
debugger back on. You will then need to recompile and run your application.
Notice the last entry in this figure, midas.dll. Midas.dll is the DLL (dynamic link library) under Windows
that contains the routines that a ClientDataSet needs. These routines are required anytime you
activate a ClientDataSet, whether you are using it with local files, as in this case, or any other way.
For example, if you are simply using a ClientDataSet to store data temporarily in memory, it will also
need access to these routines.
If you are using Kylix, the ClientDataSet relies on a shared object library named libmidas.so.1.
(Actually, libmidas.so.1 is a symbolic link. In Kylix 2, this file is symbolically linked to libmidas.so.1.0.)
This is shown in the following figure.
2 of 6 20.11.2008 17:24
Deploying Applications that use ClientDataSets http://dn.codegear.com/print/29297
I must admit that I think the Modules window is one of the more important in the IDE (integrated
development environment). This window displays all libraries that your application has loaded,
including ActiveX servers (under Windows). I make a habit of checking the Modules window before I
deploy an application. This way I can verify that I will deploy all libraries required by my application.
When you installed Delphi (or Kylix), the installer also installed the midas library. As a result, if you
create an application that employs a ClientDataSet and run it only on your development machine, that
library is already available. If you need to distribute this application you may also need to deploy this
library to a location where the application can find it. Under Windows, you will likely install this library
in the Windows system directory (or system32). With Kylix, you may need to install this file to the
location pointed to by the LD_LIBRARY_PATH environment variable.
program Project1;
uses
MidasLib,
Forms,
Unit1 in 'Unit1.pas' {Form1};
{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
3 of 6 20.11.2008 17:24
Deploying Applications that use ClientDataSets http://dn.codegear.com/print/29297
Application.Run;
end.
If you now run your application again, and then display the Modules window, it will look something
like this.
As you can see, the DLL midas.dll is not listed in this window, which means that it is no longer being
loaded by the application.
4 of 6 20.11.2008 17:24
Deploying Applications that use ClientDataSets http://dn.codegear.com/print/29297
Displaying this dialog box again after adding MidasLib to the project's uses clause and recompiling
shows that the executable has grown in size, as shown here.
5 of 6 20.11.2008 17:24
Deploying Applications that use ClientDataSets http://dn.codegear.com/print/29297
presenting.
Breaking News: Get hands-on training with Cary Jensen. Jensen Data Systems, Inc. is proud to
announce Delphi Developer Days Power Workshops, focused Delphi (TM) training. These intense,
two-day workshops give you the opportunity to explore and implement a variety of Delphi techniques
with Cary Jensen, one of the world's leading Delphi experts. Workshop topics include ClientDataSet,
IntraWeb, and more. Due to the hands-on nature of these workshops, class size is very
limited. Reserve your seat now. Click here for more information about Delphi Developer Days
Power Workshops, or visit http://www.DelphiDeveloperDays.com.
6 of 6 20.11.2008 17:24