source: cprs/branches/foia-cprs/CPRS-Chart/README.TXT@ 755

Last change on this file since 755 was 460, checked in by Kevin Toppenberg, 16 years ago

Uploading from OR_30_258

File size: 3.1 KB
Line 
15/9/2003
2========
3
4 IMPORTANT NOTE
5 TO ALL SITES UTILIZING DELPHI CPRS GUI SOURCE CODE:
6
7A problem was found in Delphi’s “ComServ.pas” file which causes problems
8with COM object registration during installation of an application
9utilizing such objects. This file explains the problem and the fix
10for it.
11
12EACH SITE MUST IMPLEMENT THIS FIX MANUALLY in order to compile CPRS.
13
14You must have the Delphi Source code to implement this fix; it is
15available only with Delphi Prossional or Delphi Enterprise (unknown:
16Delphi Developer version?). The assumption is that anyone involved
17with local modifications will have a properly-licensed version.
18
19After making the fix, DO NOT distribute the modified source code - anywhere.
20
21Explanation:
22
23If you try to register Com objects as a Restricted User (not a Power User
24or Administrator) on Win2000 or XP, ComServ.pas will always throw an unhandled
25error during program initialization because you don't have write permissions
26to the registry.
27
28The TComServer.Initialize code attempts to "squelch the exception unless
29we were explicitly told to register." But, it only traps the Ole
30Registration Error and not the Ole Sys Error that was raised in
31RegisterTypeLibrary from the OleCheck call.
32
33Two added lines were placed in the following code in the
34TComServer.Initialize procedure of the ComServ.pas unit as a
35workaround:
36
37procedure TComServer.Initialize;
38begin
39 try
40 UpdateRegistry(FStartMode <> smUnregServer);
41 except
42 on E: EOleRegistrationError do
43 // User may not have write access to the registry.
44 // Squelch the exception unless we were explicitly told to register.
45 if FStartMode = smRegServer then raise;
46 on E: EOleSysError do
47 if FStartMode = smRegServer then raise;
48 end;
49 if FStartMode in [smRegServer, smUnregServer] then Halt;
50 ComClassManager.ForEachFactory(Self, FactoryRegisterClassObject);
51end;
52
53To utilize this fix, copy the unit “ComServ.pas” into the “CPRS-Chart”
54directory, rename it to “uComServ.pas” and then make the change above to
55the “TComServer.Initialize” procedure of the new “uComserv.pas” file.
56Then add “uComServ.pas” to the project. Finally, change the "Uses" clause
57of everything that used to use "ComServ" to "uComServ" instead -- currently,
58this consists of the files uAccessibleListBox.pas, uAccessibleStringGrid.pas,
59uAccessibleTreeNode.pas, and uAccessibleTreeView.pas.
60
61NOTE that a “ComServ.pas” file IS NOT included in this zip distribution.
62You must create this file yourself (by copying and modifying) and place
63it in the “CPRS-Chart” directory. The four units listed above already
64have “uComServ” in their “Uses” clauses (in place of the “ComServ” unit
65formerly listed).
66
67This fix allows COM objects included with CPRS GUI to be registered on
68an installation machine. (Note that machines where disabled users
69will utilize applications accessing those COM objects need to have a
70Power User or Adminstrator user run the application one time (unless
71the disabled user is already a Power User or Adminstrator user) before
72ongoing usage.
Note: See TracBrowser for help on using the repository browser.