• <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>

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

            Blog @ Blog

            當(dāng)華美的葉片落盡,生命的脈絡(luò)才歷歷可見。 -- 聶魯達(dá)

            常用鏈接

            統(tǒng)計(jì)

            積分與排名

            BBS

            Blog

            Web

            最新評(píng)論

            VS2005環(huán)境ATL工程報(bào)錯(cuò):error C2065: “_Module”: 未聲明的標(biāo)識(shí)符

            寫在前面:
                   最近在接觸office編程,使用vc6.0環(huán)境Debug能編譯通過,但是ReleaseUMinDependenc編譯就報(bào)錯(cuò)libcmtd.lib(crt0.obj) : error LNK2001: unresolved external symbol _這個(gè)問題還沒有解決。希望通過CSDN有高手指點(diǎn),日后再總結(jié)6.0環(huán)境這個(gè)問題。高手門都建議學(xué)習(xí)ATL COM最好使用VS2005。折騰半天還是遇見這個(gè)錯(cuò)誤,這個(gè)錯(cuò)誤又折騰半天!通過Google有問題你就個(gè)google)找到CSDN有朋友遇見同樣的問題!他的描述如下也是我要表達(dá)的):
            VC6.0中用ATL生成的全局變量_Module, 
              CComModule  _Module; 
              可以調(diào)用_Module.GetResourceInstance(); 
               
              用VS2005生成時(shí)為_AtlModule, 
              COutLookAddinModule  _AtlModule 
              不能調(diào)用GetResourceInstance();怎么辦?
            在所有回復(fù)中沒有找到答案!但是通過QQ技術(shù)群平臺(tái)和Google還有百度找到一些方向!
            1、VS2005的wizard生成ATL后,發(fā)現(xiàn)VS2005會(huì)用子類模板化的_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 。結(jié)果自作聰明到處定義CAtlBaseModule  _Module。結(jié)果有不少新的錯(cuò)誤!還好我在CSDN發(fā)帖有問直接告訴我了!直接使用_AtlBaseModule,微軟已經(jīng)為我們定義好了!在atlcore.h定義了extern CAtlBaseModule _AtlBaseModule;
            示例如下:

            // 設(shè)置位圖按鈕風(fēng)格,位圖為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.

            附二(寫在前面提及的錯(cuò)誤,目前還沒有找到答案!貼出來希望有高手能指點(diǎn)):
            ATL 工程 中ReleaseUMinDependency與 Debug區(qū)別是什么?
            Debug可以編譯通過
            ReleaseUMinDependency編譯報(bào)錯(cuò)
            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
            這個(gè)錯(cuò)誤的修改方法如下:
            Windows項(xiàng)目要使用Windows子系統(tǒng), 而不是Console, 可以這樣設(shè)置
            [Project] --> [Settings] --> 選擇"Link"屬性頁(yè)
            在Project Options中將/subsystem:console改成/subsystem:windows 

            可是我這邊這個(gè)參數(shù)沒有錯(cuò):
            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"
            是不是因?yàn)槲业墓こ滩皇?MFC而是ATL,還有其他地方有錯(cuò)誤!
            第2個(gè)錯(cuò)誤也沒有找到具體的靜態(tài)庫(kù)!
            希望大家?guī)蛶臀遥?
            基本完成office編程(Outlook)的示例程序link

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

            廣告信息(免費(fèi)廣告聯(lián)系)

            中文版MSDN:
            歡迎體驗(yàn)

            久久亚洲精品视频| 亚洲国产成人精品91久久久 | 国产高潮国产高潮久久久91 | 久久久人妻精品无码一区 | 久久青青国产| 久久99热这里只有精品国产 | 国产69精品久久久久99| 久久99久久99小草精品免视看| 伊人久久精品无码二区麻豆| 伊人久久大香线焦AV综合影院| 狠狠色丁香婷婷久久综合五月| 偷窥少妇久久久久久久久| 久久精品国产亚洲αv忘忧草| 久久中文字幕人妻熟av女| 精品久久久无码人妻中文字幕 | 久久精品无码专区免费东京热| 亚洲国产精品无码久久久蜜芽| 亚洲AV无码1区2区久久| 99久久99久久久精品齐齐| 久久99国产精品二区不卡| 97精品国产97久久久久久免费| 久久国产乱子伦精品免费午夜| 亚洲国产视频久久| 精品久久久久久国产潘金莲| 午夜不卡888久久| 一级a性色生活片久久无| 久久亚洲AV无码精品色午夜 | 一本久久a久久精品综合夜夜 | 午夜精品久久久久久毛片| 久久99热只有频精品8| 国产精品久久免费| 久久婷婷五月综合成人D啪| 一本一道久久综合狠狠老| 亚洲国产精久久久久久久| 国内精品久久久久影院老司| 国产国产成人精品久久| 伊人情人综合成人久久网小说| AV无码久久久久不卡蜜桃| 亚洲国产综合久久天堂| 久久精品九九亚洲精品天堂| 精品久久久无码21p发布|