• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            山寨:不是最好的,是最適合我們的!歡迎體驗山寨 中文版MSDN

            Blog @ Blog

            當華美的葉片落盡,生命的脈絡才歷歷可見。 -- 聶魯達

            常用鏈接

            統計

            積分與排名

            BBS

            Blog

            Web

            最新評論

            VS2005環境ATL工程報錯:error C2065: “_Module”: 未聲明的標識符

            寫在前面:
                   最近在接觸office編程,使用vc6.0環境Debug能編譯通過,但是ReleaseUMinDependenc編譯就報錯libcmtd.lib(crt0.obj) : error LNK2001: unresolved external symbol _這個問題還沒有解決。希望通過CSDN有高手指點,日后再總結6.0環境這個問題。高手門都建議學習ATL COM最好使用VS2005。折騰半天還是遇見這個錯誤,這個錯誤又折騰半天!通過Google有問題你就個google)找到CSDN有朋友遇見同樣的問題!他的描述如下也是我要表達的):
            VC6.0中用ATL生成的全局變量_Module, 
              CComModule  _Module; 
              可以調用_Module.GetResourceInstance(); 
               
              用VS2005生成時為_AtlModule, 
              COutLookAddinModule  _AtlModule 
              不能調用GetResourceInstance();怎么辦?
            在所有回復中沒有找到答案!但是通過QQ技術群平臺和Google還有百度找到一些方向!
            1、VS2005的wizard生成ATL后,發現VS2005會用子類模板化的_AtlModule代替原來VC6.0的_Module
            2、VS2005中 ATL 7.0取代了vc6.0中的 ATL 3.0。
            3、MSDN英文中有提到CAtlBaseModule   Contains information required by most applications that use ATL. Contains the HINSTANCE of the module and the resource instance.
            也就是說要使用GetResourceInstance();  必須派生于CAtlBaseModule 。結果自作聰明到處定義CAtlBaseModule  _Module。結果有不少新的錯誤!還好我在CSDN發帖有問直接告訴我了!直接使用_AtlBaseModule,微軟已經為我們定義好了!在atlcore.h定義了extern CAtlBaseModule _AtlBaseModule;
            示例如下:

            // 設置位圖按鈕風格,位圖為x32大小,將其放入剪切板中用PasteFace()貼在指定按鈕上
                    HBITMAP hBmp =(HBITMAP)::LoadImage(_AtlBaseModule.GetResourceInstance(),
                        MAKEINTRESOURCE(IDB_BITMAP),IMAGE_BITMAP,
            0,0,LR_LOADMAP3DCOLORS);


            附一:
            Earlier versions of ATL used CComModule. In ATL 7.0, CComModule functionality is replaced by several classes:

            CAtlBaseModule   Contains information required by most applications that use ATL. Contains the HINSTANCE of the module and the resource instance.

            CAtlComModule   Contains information required by the COM classes in ATL.

            CAtlWinModule   Contains information required by the windowing classes in ATL.

            CAtlDebugInterfacesModule   Contains support for interface debugging.

            CAtlModule   The following CAtlModule-derived classes are customized to contain information required in a particular application type. Most members in these classes can be overridden:

            CAtlDllModuleT   Used in DLL applications. Provides code for the standard exports.

            CAtlExeModuleT   Used in EXE applications. Provides code required in an EXE.

            CAtlServiceModuleT   Provides support to create Windows NT and Windows 2000 Services.

            CComModule is still available for backward compatibility.
            Earlier versions of ATL used CComModule. In ATL 7.0, CComModule functionality is replaced by several classes:

            CAtlBaseModule   Contains information required by most applications that use ATL. Contains the HINSTANCE of the module and the resource instance.

            CAtlComModule   Contains information required by the COM classes in ATL.

            CAtlWinModule   Contains information required by the windowing classes in ATL.

            CAtlDebugInterfacesModule   Contains support for interface debugging.

            CAtlModule   The following CAtlModule-derived classes are customized to contain information required in a particular application type. Most members in these classes can be overridden:

            CAtlDllModuleT   Used in DLL applications. Provides code for the standard exports.

            CAtlExeModuleT   Used in EXE applications. Provides code required in an EXE.

            CAtlServiceModuleT   Provides support to create Windows NT and Windows 2000 Services.

            CComModule is still available for backward compatibility.

            附二(寫在前面提及的錯誤,目前還沒有找到答案!貼出來希望有高手能指點):
            ATL 工程 中ReleaseUMinDependency與 Debug區別是什么?
            Debug可以編譯通過
            ReleaseUMinDependency編譯報錯
            Linking...
              Creating library ReleaseUMinDependency/WordCOM.lib and object ReleaseUMinDependency/WordCOM.exp
            LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
            ReleaseUMinDependency/WordCOM.dll : fatal error LNK1120: 1 unresolved externals
            Error executing link.exe.

            WordCOM.dll - 2 error(s), 0 warning(s)

            注意:
            查資料反饋
            libcmtd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
            這個錯誤的修改方法如下:
            Windows項目要使用Windows子系統, 而不是Console, 可以這樣設置
            [Project] --> [Settings] --> 選擇"Link"屬性頁
            在Project Options中將/subsystem:console改成/subsystem:windows 

            可是我這邊這個參數沒有錯:
            kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /incremental:no /pdb:"ReleaseUMinDependency/OutLookAddin.pdb" /machine:I386 /def:".\OutLookAddin.def" /out:"ReleaseUMinDependency/OutLookAddin.dll" /implib:"ReleaseUMinDependency/OutLookAddin.lib"
            是不是因為我的工程不是 MFC而是ATL,還有其他地方有錯誤!
            第2個錯誤也沒有找到具體的靜態庫!
            希望大家幫幫我!
            基本完成office編程(Outlook)的示例程序link

            posted on 2008-10-17 23:27 isabc 閱讀(4562) 評論(0)  編輯 收藏 引用 所屬分類: BUG分析

            廣告信息(免費廣告聯系)

            中文版MSDN:
            歡迎體驗

            亚洲AV无码久久精品色欲| 久久99精品国产| 久久丫精品国产亚洲av不卡| 亚洲精品tv久久久久久久久| 久久综合九色综合久99| 久久天天躁夜夜躁狠狠| 久久精品国产清高在天天线| 久久久这里只有精品加勒比| 久久精品亚洲一区二区三区浴池 | 久久免费香蕉视频| 99久久国产综合精品成人影院| 亚洲嫩草影院久久精品| 狠狠色丁香婷综合久久| 久久综合久久美利坚合众国| 国产日产久久高清欧美一区| 久久夜色精品国产噜噜麻豆| 亚洲精品97久久中文字幕无码| 久久青青草原国产精品免费| 99久久er这里只有精品18| 久久精品国产亚洲AV电影| 久久综合狠狠综合久久| 人人妻久久人人澡人人爽人人精品| 三级片免费观看久久| 久久久无码精品午夜| 精产国品久久一二三产区区别 | 国产精自产拍久久久久久蜜| 国产精品伊人久久伊人电影| 色综合久久天天综线观看| 久久精品www人人爽人人| 国产婷婷成人久久Av免费高清| 国产69精品久久久久99尤物| 一本久道久久综合狠狠躁AV| 久久亚洲精精品中文字幕| 久久久中文字幕日本| 久久最近最新中文字幕大全 | 久久人人爽人人爽人人AV| 99久久无码一区人妻a黑| 综合网日日天干夜夜久久| 久久狠狠一本精品综合网| 日韩精品无码久久一区二区三| 久久人妻AV中文字幕|