ide.htm

来自「对于学习很有帮助」· HTM 代码 · 共 213 行

HTM
213
字号
<!-- This document was created with HomeSite v2.5 -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">

<HTML>
<HEAD>
	<TITLE>UDDF - IDE</TITLE>
	<META NAME="Description" CONTENT="IDE section of the Delphi Developers FAQ" >
	<META NAME="Keywords" CONTENT="" >

</HEAD>
<BODY  bgcolor="#FFFFFF">
<CENTER>
<IMG SRC="../images/uddf.jpg"> </CENTER>
<HR SIZE="6" COLOR="LIME">

<CENTER><FONT SIZE="7" FACE="Arial Black" COLOR="RED">IDE</FONT></CENTER>


<P><H1><A NAME="ide0">View CPU debug info</P></A></H1>
<P><I>From: Martin Larsson &lt;martin.larsson@delfi-data.msmail.telemax.no&gt;</I></P>

<HR><PRE>HKEY_CURRENT_USER\Software\Borland\Delphi\2.0\Debugging\EnableCPU = "1"</PRE><HR>

<P><H1><A NAME="ide1">My applications directory</P></A></H1>
<P><I>From: "David S. Becker" &lt;dsb@plaza.ds.adp.com&gt;</I></P>

<P>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!</P>

<P><H1><A NAME="ide2">Error Numbers</P></A></H1>
Error #	Error Message
<PRE>
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
</PRE>

{ This code came from Lloyd's help file! }

<P><H1><A NAME="ide3">16-bitAppl with delphi 2??</P></A></H1>
<P><I>From: "Rodney E Geraghty" &lt;gerarod@ibm.net&gt;</I></P>

  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.


<P><H1><A NAME="ide4">Sharing ObjectRepository</P></A></H1>
<P><I>Delphi Developer's Jrnl &lt;tim_gooch@cobb.com&gt;</I></P>

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.)  <p>

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

     Copy the Object Repository files you want to share to a new
directory. <br>
     Copy the Delphi32.Dro file from the \Delphi 2.0\Bin directory into
the 
       new Object Repository directory. <br>
     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. <br>
     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. <br>
     Restart Delphi 2.0 for each user. <p>

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. <p>

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.) <p>

<U>****** Example *******</U><p>

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 <P>

<tt>  C:\PROGRAM FILES\BORLAND\DELPHI 2.0\OBJREPOS</tt><p>

and replace them with <p>

<tt>  C:\Object Repository 2</tt><p>

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 <p>

<TT>  Software/Borland/Delphi/2.0/Repository </TT> <p>

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 <p>

<tt>  C:\Object Repository 2</tt><p>

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. <P>

<P><H1><A NAME="ide5">How to detect if running in IDE?</P></A></H1>
<H2> Solution 1</H2>
<P><I>From: "Robert KORITNIK" &lt;Robert.Koritnik@repro.si&gt;</I></P>

<HR><PRE>if csDesigning in ComponentState then</PRE><HR>
 ..... <P>

That's how you do it...<P>
<H2>Solution 2</H2>
<P><I>Mike O'Hanlon &lt;TMike@IAFRICA.COM&gt;</I></P>

  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.

<HR><PRE> 
function LaunchedFromDelphiIDE: Boolean;
{----------------------------------------------------------------}
{ Checks whether calling application was launched from the IDE.  }
{ From a posting to Delphi-Talk by Ed Salgado &lt;easalgad@ICSI.Net&gt;}
{ of Eminent Domain Software.                                    }
{----------------------------------------------------------------}
 begin
   LaunchedFromDelphiIDE := Bool(PrefixSeg) {ie. not a DLL} and
                            Bool(PWordArray(MemL[DSeg:36])^[8]);
 end; {LaunchedFromDelphiIDE}
</PRE><HR>


<HR SIZE="6" COLOR="LIME">
<FONT SIZE="2">
<a href="mailto:rdb@ktibv.nl">Please email me</a> and tell me if you liked this page.<BR>
<SCRIPT LANGUAGE="JavaScript">
<!--
	document.write("Last modified " + document.lastModified);
// -->
</SCRIPT><P>
<TABLE BORDER=0 ALIGN="CENTER">
<TR>
	<TD>This page has been created with </TD>
	<TD> <A HREF="http://www.dexnet.com./homesite.html"><IMG SRC="../images/hs25ani.gif" WIDTH=88 HEIGHT=31 BORDER=0 ALT="HomeSite 2.5b">
</A></TD>
</TR>
</TABLE>

</FONT>



</BODY>
</HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?