{$R *.DFM}  这一行代表什么意思?

解决方案 »

  1.   

    把pas文件对应的dfm文件(窗体的脚本文件)当资源编译进去。
      

  2.   

    Type Parameter
    Syntax {$R filename}
             {$RESOURCE filename}{$R *.xxx}
             {$R filename.RES filename.RC}
    Scope LocalResThe $R directive specifies the name of a resource file to be included in an application or library. The named file must be a Windows resource file and the default extension for filenames is .RES. To specify a file name that includes a space, surround the file name with single quotation s: {$R 'My file'}.
    The * symbol has a special meaning in $R directives: it stands for the base name (without extension) of the source-code file where the directive occurs. Usually, an application抯 resource (.RES) file has the same name as its project (.DPR) file; in this case, including {$R *.RES} in the project file links the corresponding resource file to the application. Similarly, a form (.DFM) file usually has the same name as its unit (.PAS) file; including {$R *.DFM} in the .PAS file links the corresponding form file to the application.{$R filename.RES filename.RC} (where the two occurrences of 'filename' match) makes the .RC file appear in Delphi's Project Manager. When the user opens the .RC file from the Project Manager, the String Table editor is invoked.
    When a {$R filename} directive is used in a unit, the specified file name is simply recorded in the resulting unit file. No checks are made at that point to ensure that the filename is correct and that it specifies an existing file.
    When an application or library is linked (after compiling the program or library source file), the resource files specified in all used units as well as in the program or library itself are processed, and each resource in each resource file is copied to the executable being produced. During the resource processing phase, Delphi's linker searches for .RES files in the same directory as the module containing the $R directive, and in the directories specified in the Search path input box on the Directories/Conditionals page of the Project|Options dialog box (or in the directories specified in a /R option on the DCC32 command line).看看就知道了。
      

  3.   

    {$R *.DFM}意思是程序编译时将自动产生并应用与当前项目文件同名的DFM文件。
      

  4.   

    表示引用dfm窗体文件,*.dfm表示文件名与此单元文件名相同。
    如果没有这行,系统就找不到窗体。
      

  5.   

    $R用于加载一个外部资源文件,
    *.DFM 中*表示与当前文件同名的文件,不是通配符
    .DFM 表示由DELPHI创建的窗体
    $R *.DFM表示在编译的时候将*.DFM代表的窗体链接到可执行文件中。
    OK,就这些了!
      

  6.   

    我想向各位大侠们请教一个问题,我是刚出学校的的一个大学生,现在我对软件编程非常的感兴趣,我准备来学习这方面(需要说明的是,我现在在一个学校教书)。我想学习delphi,可是我没有什么信心,我不知道我能够用多长的时间才能够学好,不知道自己究竟应该怎么去学,我只是以前在学校的时候学习过一点pascal,我也正在看object pascal,可是,好难看懂,在我的周围,没有人可以请教。就是连一个起码的到处都是的Tobject类我都不知道,我不知道在那些类的前面加上一个字母T的意思是什么……在这个时候,我真的好想退却,可是我很不甘心,我真的很不甘心……各位大哥们,小妹在这里向你们请教了:我能够学好delphi吗?Tobject究竟是什么东西?我用心的学习的话,用多长的时间可以见成效呢???    忠诚急切的盼望你们的答复!!!
      

  7.   

    To reallike:这么多回答问题的人不也一样不知道吗?
      

  8.   

    一句编译器指令
    $R *.DFM表示在编译的时候将*.DFM代表的窗体链接到可执行文件中。