有關Delphi8 製作 Dll的問題 |
尚未結案
|
S1990xyz
一般會員 發表:6 回覆:13 積分:3 註冊:2003-03-03 發送簡訊給我 |
請問一下各位先進, 我用Delphi8做了一個Dll
開啟另外一個Project然後add reference
到Project中, 一Compile就出現 [Fatal Error] Could not import assembly 'Library1' because it contains namespace 'Borland.Delphi.System' 不過讓C# builder加入Reference就可以Work..., 我查了一下Help
裡面的意思應該是Borland.Delphi.System這個Namespace只能由
Borland.Delphi.dll呼叫...
不知道怎麼解ㄟ... :(
|
code6421
版主 發表:43 回覆:223 積分:208 註冊:2002-08-16 發送簡訊給我 |
引言: 請問一下各位先進, 我用Delphi8做了一個Dll 開啟另外一個Project然後add reference 到Project中, 一Compile就出現 [Fatal Error] Could not import assembly 'Library1' because it contains namespace 'Borland.Delphi.System' 不過讓C# builder加入Reference就可以Work..., 我查了一下Help 裡面的意思應該是Borland.Delphi.System這個Namespace只能由 Borland.Delphi.dll呼叫... 不知道怎麼解ㄟ... :(use package(not library) to create regular .NET Assemblies. Just coding... Taiwan:http://code6421.ktop.com.tw China:http://home.hoolee.com/~code6421
------
Just codeing... |
S1990xyz
一般會員 發表:6 回覆:13 積分:3 註冊:2003-03-03 發送簡訊給我 |
|
suckin
一般會員 發表:13 回覆:26 積分:7 註冊:2003-06-16 發送簡訊給我 |
|
microbean
初階會員 發表:1 回覆:43 積分:38 註冊:2004-04-09 發送簡訊給我 |
可以參考一下下面的文章
有詳細的說明 : http://www.pinnaclepublishing.com/html/main.isx?sub=52&story=2679 The reason is simple, but surprising. The fact that the Library project contained no external references resulted in the fact that the Borland.Delphi.System unit was linked into it. And adding this Library Assembly to another Delphi for .NET project, which also contains the Borland.Delphi.System unit, leads to a Fatal Error message that says that it couldn't import assembly Library1 because it contains namespace Borland.Delphi.System (which is also included in the new project itself). In order to solve this problem, you need to reload the Library Assembly project in the IDE, and right-click on the Library1 project node to add a reference to the Borland.System.dll. This way, the Library Assembly will still use the Borland.Delphi.System unit, but from an external assembly reference. Like a runtime package. And this time, the Library1.dll will even be 6,656 bytes! Now when you add the Library1.dll Assembly to a Delphi for .NET project, it will compile just fine, since both the Library1.dll assembly and the Delphi for .NET project will refer to the same external Borland.System.dll. 補充一下 :
我實際測過
文中應該是要 add "Borland.Delphi.dll" 而不是 "Borland.System.dll"
(下載 sample source 就可以看到)
此法於 Win Form 中適用 , 於 Vcl Form 中 有問題. 發表人 - microbean 於 2004/04/09 19:38:20
|
suckin
一般會員 發表:13 回覆:26 積分:7 註冊:2003-06-16 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |