MozTW 討論區

各項 Mozilla 相關軟體與技術討論
現在的時間是 2025-08-07, 19:29

所有顯示的時間為 UTC + 8 小時





發表新文章 回覆主題  [ 3 篇文章 ] 
發表人 內容
文章發表於 : 2007-10-23, 11:08 
離線

註冊時間: 2007-10-22, 16:26
文章: 5
我參照了下列兩個網址的步驟成功的使用了Visual Studio 2005 express來編譯出dll也產生出了xpt

http://www.iosart.com/firefox/xpcom/
http://starkravingfinkle.org/blog/2006/10/mozilla-platform-xpcom-in-c/

分別放置到plugins以及components兩目錄

接著使用了regxpcom來註冊元件, 也刪除了xpti.dat, compreg.dat兩檔案, 重新啟動firefox之後卻還是沒辦法使用這兩個元件

請問問題是出在哪裡? 謝謝

元件原始檔
測試網頁


回頂端
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 1.1.4322)
 個人資料  
引用回覆  
 文章主題 :
文章發表於 : 2007-10-23, 12:11 
離線

註冊時間: 2007-10-22, 16:26
文章: 5
而我另外使用了visual studio 6來編譯, 卻得到下面的錯誤訊息
代碼:
nsNetutilModule.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) unsigned int __cdecl NS_NewGenericModule2(struct nsModuleInfo *,class nsIModule * *)" (__imp_?NS_NewGenericModule2@@YAIPAUnsModuleInfo@@PAPAVnsIModule@@@Z)
plugin___Win32_Debug/plugin.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.


回頂端
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 1.1.4322)
 個人資料  
引用回覆  
 文章主題 :
文章發表於 : 2007-10-23, 16:46 
離線

註冊時間: 2007-10-22, 16:26
文章: 5
自問自答已解決
代碼:
Open Visual C++ 6
New / Project / Create an Win32 Dynamic-Link Library project
Project / Settings
    Setting For: Win32 Release
    C/C++
        Category General / append XP_WIN,XP_WIN32,MOZILLA_STRICT_API at Preprocessor definitions
        Category Precompiled Headers / choose Not using precompiled headers
        Category Preprocessor / set the value of Additional include directories to C:\cygwin\usr\win32\gecko-sdk\include
    Link / Category Input
        append nspr4.lib xpcom.lib xpcomglue_s.lib at Object/library modules
        set th value of Ignore library\ies to msvcrt.lib
        set the value of Additional library path to C:\cygwin\usr\win32\gecko-sdk\lib


回頂端
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 1.1.4322)
 個人資料  
引用回覆  
顯示文章 :  排序  
發表新文章 回覆主題  [ 3 篇文章 ] 

所有顯示的時間為 UTC + 8 小時


誰在線上

正在瀏覽這個版面的使用者:沒有註冊會員 和 2 位訪客


不能 在這個版面發表主題
不能 在這個版面回覆主題
不能 在這個版面編輯您的文章
不能 在這個版面刪除您的文章
不能 在這個版面上傳附加檔案

搜尋:
前往 :  
Powered by phpBB® Forum Software © phpBB Group
正體中文語系由 竹貓星球 維護製作
© moztw.org, Mozilla Foundation
MozTW,Mozilla 台灣社群