麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 編程 > Delphi > 正文

Delphi2005學習筆記4——再談NameSpace和Dll以及Package

2019-11-18 18:07:26
字體:
來源:轉載
供稿:網友
今天在BDN中看到一篇文章
http://bdn.borland.com/article/0,1410,32765,00.html

重要的部分摘抄如下

Executive Summary

          Namespaces do not affect Delphi for Win32.

          Namespaces are PRoduced based on the unit name as follows:

          If a unit name is dotted then the unit name up to the last dot is used.

          If it is not dotted then the default namespace is used.

          If there is no default namespace then the unit name is used.

          Code converted from Delphi 8 may require some modifications.

          Always use Packages not Libraries to create shareable assemblies.

          Delphi will always refer to types by their full unit name.

          Other languages will need to refer to types using their namespace.

          asp.net declarations, configuration files and .NET reflection always refer to types by their namespace.

          If multiple units emit a public type with the same name into the same namespace, the assembly may be unusable

1)     Always Use Packages

Borland has always recommended not using library projects to create assemblies. In Delphi 2005, the compiler is stricter and will no longer allow you to compile an application referencing a Delphi ‘library’.
Always use a package project to create .NET assemblies.

However, as with anything, there are exceptions to the rule and there are several situations where you need to use the namespace even though you are coding in Delphi.

 

One example is when you are using tags in ASPX, ASCX or ASMX files. If you create a web page called TWebForm in the file Application.­Pages.­WebForm1.­­pas then the page tag would be:

 

<%@Page Language="c#" Codebehind="WebForm1.pas" Inherits="Application.Pages.TWebForm1"%>

 

Another is when passing type information to .NET in the form of strings, especially when using reflection based APIs and configuration files:

 

var c:TypeConverter;

c:=Assembly.CreateInstance('Sample.Controls.TConverter');

 

This slight difference commonly trips people up and is something you need to be careful of, especially when porting code from Delphi 8 or converting code from other languages.

這就解釋了我原來的疑問,在D2005中,新建一個.Net Dll,編譯,在別的編譯器中(C#),可以使用,但是在Delphi中自己卻不能用,雖然用薄可以解決問題,但是包中添加資源很不方便,真是不知道Borland是怎么想的。



上一篇:delphi7找不到TBDEClientDataSet控件的解決方案

下一篇:Delphi幫助里的虛擬鍵值表

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
學習交流
熱門圖片

新聞熱點

疑難解答

圖片精選

網友關注

主站蜘蛛池模板: 国产精品久久av | 精品一区二区三区四区在线 | 欧美视频一级 | 精品国产一二区 | 素人视频在线观看免费 | 播色网 | 国产一级在线观看视频 | a视频在线播放 | 欧美性黄| 热99re久久免费视精品频软件 | 成年人在线视频免费 | 竹内纱里奈和大战黑人 | 7777在线视频免费播放 | 日本一区二区久久 | 七首小情歌泰剧在线播放 | 国产精品99久久久久久久女警 | 人成免费a级毛片 | 久久超碰99| 激情小说另类 | 欧洲成人综合网 | 久久国产在线观看 | 成人一级毛片 | 色七七亚洲 | 国产精品视频2021 | 黄色网址进入 | 99成人精品视频 | 毛片视频网址 | japanesexxxxxxxhd | 国产精品久久久久久久久久久久久久久久 | 午夜爽爽爽男女免费观看hd | 高清在线观看av | 久久人人爽人人爽人人片av免费 | 一区二区精品视频在线观看 | 欧美成人高清视频 | 国产午夜亚洲精品理论片大丰影院 | 国产小视频在线观看 | 国产毛毛片一区二区三区四区 | 视频一区二区国产 | 麻豆国产网站 | 天天干干 | 特黄一级小说 |