IDE

View CPU debug info

From: Martin Larsson <martin.larsson@delfi-data.msmail.telemax.no>


HKEY_CURRENT_USER\Software\Borland\Delphi\2.0\Debugging\EnableCPU = "1"

My applications directory

From: "David S. Becker" <dsb@plaza.ds.adp.com>

Application.EXEName gives the completely qualified name of your application, including drive and path. Simply use the ExtractFilePath() function with Application.EXEName as its parameter to get just the drive and path. Easy!

Error Numbers

Error # Error Message
1	Invalid function number
2	File not found
3	Path not found
4	Too many open files
5	File access denied

6	Invalid file handle
12	Invalid file access code
15	Invalid drive number
16	Cannot remove current directory
17	Cannot rename across drives
100	Disk read error
101	Disk write error
102	File not assigned
103	File not open
104	File not open for input
105	File not open for output
106	Invalid numeric format
200	Division by zero
201	Range check error
202	Stack overflow error
203	Heap overflow error
204	Invalid pointer operation
205	Floating point overflow

206	Floating point underflow
207	Invalid floating point operation
210	Object not initialized
211	Call to abstract method
212	Stream registration error
213	Collection index out of range
214	Collection overflow error
215	Arithmetic overflow error
216	General protection fault
{ This code came from Lloyd's help file! }

16-bitAppl with delphi 2??

From: "Rodney E Geraghty" <gerarod@ibm.net>

You can't create 16-bit programs using Delphi 2.0 it is 32-bit only. The good news is that, as far as I know, all versions of D2 also come with Delphi 1.0 on the CD which is 16-bit. You'll have to load it or you can run it from the CD by using the Delphi16/RunImage directory on the CD. Note that this will not work if you have used some of the unique Win95 components in D2 or if you have used Win32 specific API calls. To do this you'll have to copy the *.dpr, *.dfm and *.pas files for your app to another directory (do not copy the *.dcu, *.opt or *.res file that D2 generates or you'll get errors) and recompile them using D1.

Sharing ObjectRepository

Delphi Developer's Jrnl <tim_gooch@cobb.com>

To share form and project templates among Delphi 2.0 users, the process is a bit more complex than for Delphi 1.0, but the main idea is the same. The biggest difference is that you can add a form to the Object Repository that doesn't exist in the same directory structure as the Repository itself. Because of this situation, Delphi 2.0 can't assume (as Delphi 1.0 did) that all the form or project template files will be in the same directory or a predictable subdirectory. (This disparity also has important implications for the forms and projects that you want to share from the Object Repository. We'll describe these implications shortly.)

To share an Object Repository among several users, you'll do the following:

Copy the Object Repository files you want to share to a new directory.
Copy the Delphi32.Dro file from the \Delphi 2.0\Bin directory into the new Object Repository directory.
Find all occurrences of the old Object Repository directory path in the new Delphi32.Dro file and replace them with the appropriate path to the new directory.
Add a BaseDir= entry to the Repository section of the Delphi 2.0 System Registry entries to identify the location of the shared Object Repository.
Restart Delphi 2.0 for each user.

As you might guess, the one problem in this process arises when you try to share a form or project that doesn't exist within the default \OBJREPOS directory structure. If you've added projects or forms to the Object Repository and the directory doesn't exist in a subdirectory of the main Object Repository directory, you'll need to copy the appropriate files for those projects and forms to the new directory. In addition, to reflect the new paths, you'll have to adjust the path statements in the Delphi32.Dro file that reference these files.

If you don't make these changes, as each user loads the common Delphi32.Dro file, the user's copy of Delphi 2.0 will begin searching local hard disks for projects and forms that don't exist. (These projects and forms exist only on the system where you created them.)

****** Example *******

Now let's specify a shared Object Repository for Delphi 2.0. To begin, create a new directory named C:\Object Repository 2, and then copy all of the files and directories from the \OBJREPOS directory into the new directory. In addition, copy the Delphi32.Dro file from the \Delphi 2.0\Bin directory to the new directory. Launch a text editor and open the Delphi32.Dro file. In this file, find all the occurrences of the old Object Repository path, such as

C:\PROGRAM FILES\BORLAND\DELPHI 2.0\OBJREPOS

and replace them with

C:\Object Repository 2

This search-and-replace task will change the Delphi32.Dro file in several places. Next, launch the Registry Editor application (REGEDT32.EXE), and locate the subkey named

Software/Borland/Delphi/2.0/Repository

in the HKEY_CURRENT_USER section. In this section, add a new string value (data type REG_SZ) named BaseDir, and set its value to

C:\Object Repository 2

When you finish adding the new string value, exit the Registry Editor. The next time you launch Delphi 2.0, the new directory will contain the project and form templates in your Object Repository.

How to detect if running in IDE?

Solution 1

From: "Robert KORITNIK" <Robert.Koritnik@repro.si>


if csDesigning in ComponentState then

.....

That's how you do it...

Solution 2

Mike O'Hanlon <TMike@IAFRICA.COM>

Here's a routine that works for Delphi 1. If you're using Delphi 2 and it also seems to work in that environment, please let me know.
 
function LaunchedFromDelphiIDE: Boolean;
{----------------------------------------------------------------}
{ Checks whether calling application was launched from the IDE.  }
{ From a posting to Delphi-Talk by Ed Salgado <easalgad@ICSI.Net>}
{ of Eminent Domain Software.                                    }
{----------------------------------------------------------------}
 begin
   LaunchedFromDelphiIDE := Bool(PrefixSeg) {ie. not a DLL} and
                            Bool(PWordArray(MemL[DSeg:36])^[8]);
 end; {LaunchedFromDelphiIDE}


Please email me and tell me if you liked this page.

This page has been created with