ATL COM Support MFC的问题一个!

lngjw 2002-06-12 04:36:34
--------------------Configuration: atl - Win32 Debug--------------------
Compiling...
atl.cpp
c:\cs\atl\atl_i.c(38) : error C2370: 'LIBID_ATLLib' : redefinition; different storage class
c:\program files\microsoft visual studio\vc98\atl\include\atlbase.h(79) : see declaration of 'LIBID_ATLLib'
Error executing cl.exe.

atl.dll - 1 error(s), 0 warning(s)

帮忙看看吧,为什么!
...全文
36 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Goesthe 2002-06-12
  • 打赏
  • 举报
回复
都是工程名字‘ATL‘惹的祸:)和VC的ATL冲突了,改个名字就好了
PioneerMan 2002-06-12
  • 打赏
  • 举报
回复
打补丁没有?VC的SP5
其它几个不能下载,压缩后重新上传。 Learn how to build sophisticated COM objects using C++ and IDL, as well as how ATL supplies support for several COM procedures. Understanding COM takes time and energy. I can say with great confidence that there is always more to learn. However, as with most technologies, COM does provide a core body of knowledge that works as the backbone for just about everything else. For example, once you understand the building blocks of interfaces, coclasses, class factories, and COM binaries, the foundation is laid for numerous related aspects of COM, such as the ActiveX control, distributed COM, and connectable objects (just to name a few). The relationship between COM and the numerous ActiveX technologies out there can be equated to an understanding of mathematics and the various applied sciences. If you don't understand how to work with basic algebraic equations, you can forget taking classes in physics, chemistry, and biology. The same holds true here: Without an understanding of the algebra of COM, forget the science of ActiveX. Moreover, without an understanding of COM, forget ATL. Once an individual has come to understand the core building blocks of the COM architecture, the next logical step is to adopt a component framework to help lessen the burden of repetitive code. ATL is the C++ developer's COM framework of choice. With ATL by your side, you can successfully spend less time handing out interface pointers and more time concentrating on the domain-specific coding task at hand. However, an ATL developer who does not understand the architecture of COM is no better off than an MFC developer who has no understanding of the central Win32 APIs. This book offers a firm foundation in COM, as well as the ATL framework.
1,ATLAux.zipA set of VC++ helpers and patterns to help automate some routine coding tasks.(35KB)2,CltnWizard.zipATL object wizard that creates a collection of other COM objects(37KB)3,gridctrlatl.zipA grid control for displaying tabular data, based on Chris Maunder's grid control(101KB)4,TempMonitor.zipA step by step tutorial on using ATL controls in MFC(47KB)5,SAWzip.zipAn ATL based control for reading and writing zip files(187KB)6,Property12.zipDescribes an ActiveX Control to use OLE Automation to set an object's properties.(222KB)7,AlxGrd.zipDescribes an ActiveX Control to use OLE Automation to set an object's properties.(215KB)8,ATLLog_demo.zipA simple logging utility to help debug your ATL applications(48KB)9,ATL_pp_wizard.zipA wizard that allows you to create an ATL Object Wizard Property Page(74KB)10,AtlSplitter.zipATL Splitter ActiveX control(94KB)11,Com_Atl.zipBeginner's Tutorial: COM/ATL Simple Project(19KB)12,ienum.zipA simplified method to enumerate a collection of objects.(137KB)13,ConExe_demo.zipAn article on ATL COM event connection point threading issues(72KB)14,RBDeskBand.zipAn ATL Object Wizard that creates an DeskBand COM Object implementation(149KB)15,instmsi.zipThis is an ATL Object Wizard that eases window development using CWindowImpl. It removes the redundant copy-n-paste of code between class implementations(1437KB)16,DrawingD.zipDrawing complex ATL/ActiveX controls at designtime(38KB)17,ATLDateLib.zipNon-MFC Date Routines in an ATL Component.(10KB)18,shellext.zipA wizard that allows you to create an ATL Property Page or Context Menu extensions(77KB)19,StructStg.zipA wrapper class for most common IStorage methods and API calls.(20KB)20,PropBrowser.zipAllows you to easily create property pages for ActiveX controls(59KB)21,Redirect.zipAn ATL-control for redirecting stdout/stdin(55KB)22,kPad.zipAn example of using the WTL library and RichEdit control(131KB)23,rsPrevFontcmb.zipA font combo box that previews the fonts in the dropdown view(30KB)24,ButtonMenu.zipUse WTL to create simple button that implements drop-down menu(19KB)25,DocViewWTL.zipA library that provides the easiest way to get loosely coupled components.(163KB)26,update_wtl.zipNotes on updating your WTL installation(2KB)27,sidebarmenu.zipAn article about changing the look of WTL icon menu(85KB)28,customdraw.zipHow to use WTL to create custom controls(20KB)29,WTLDocs1.zipBeginning Documentation on WTL(71KB)30,Toolbar.zipAn article on extending the tool bar control using the Window Template Library(64KB)31,propsheetddx.zipDemonstrates how to use DDX/DDV and tabbed property sheets with WTL(35KB)32,donut_demo.zipMDI and Tab WebBrowser(168KB)33,JCB.zipA Java Class Browser written in C++ using WTL(139KB)34,MenuBtn.zipUse of a Push button with a drop down menu(21KB)35,AutoATL.zipUsing ATL to Automate a MFC Application Or, Creating Hybrid MFC ATL COM Objects(41KB)36,atlcontain.zipUsing Containment In ATL - A Complete Application(202KB)37,atnt_src.zipSplitter window control(454KB)38,msform.exeActiveX script hosting - 2(123KB)39,axhost.exeActiveX script hosting(109KB)40,ATL_Script.zipImplementing Active Script Site with ATL(52KB)41,actvdbg.zipAdding Debug facilities to an Active Scripting Host(86KB)42,Gif89a.zipA Control for Displaying Animated GIF Images(221KB)43,proppagec.zipActiveX Control Property Page Container(40KB)44,qlistctrl.zipQListCtrl - a popup list box like that in Visual C++ 6.0(36KB)45,ncombo.zipAn Enhanced Combo Box Control.(194KB)46,XFloorWnd.zipFloor Window Control(341KB)47,propgrid.zipProperties Grid Control(239KB)48,dscdao.zipData Source ActiveX control for DAO(201KB)49,rnso.zipRNSO - A Remote Notifiers,Subjects and Observers Server over DCOM(197KB)50,multiarray.zipUsing a Multidimensional SAFEARRAY to pass data across from COM objects (50KB)51,safearray.zipPassing DYNAMIC Data QUICKLY using SafeArrays - 2(71KB)52,comcollec.zipCOM Collection Template Class(30KB)53,AXDocc.zipProgramming Active Document Containers(114KB)54,MBV_Demo.zipMBV Wizard and the COM Container Library(105KB55,WaveEdAt.zipA COM-based Automation Wave File Editor(124KB)56,bankaccount1.zipHandling Interdependent Objects in Automation An Example of a Bank Server Object(53KB)57,aspfile.zipAn ASP Component to Send Arbitary Large File from Server to Client(62KB)58,tlbrowser.zipWriting a simple Typelibrary browser(45KB)59,tiatut.zipBuilding a World Class Application with MFC and COM Automation(197KB)60,asyncpp.zipAsynchronous Pluggable Protocol(11KB)61,comarray.zipPassing arrays of structures in COM.(24KB)62,olefile.zipCOleFileManager - encapsulates the ugly details of implementing compound file support(4KB)63,VBCollecs.zipSimple STL Collections in ATL(14KB)64,hyperlinks.zipActiveX hyper linking(389KB)65,activex.zipActiveX Control Tutorial(89KB)66,atlexamp.zipLeveraging C++ Applications Using COM An Example Using ATL COM(52KB)67,docviewcom.zipLeveraging C++ Applications Using COM An Extension of the Document View Architecture(86KB)68,atlclienttut.zipATL Client Application Tutorial(51KB)69,wordauto.zipAutomation And Eventing With Microsoft Word(32KB)
--Shine Chen 1 进程内 COM 组件的实现 1 实验目的 Microsoft 的 COMComponent Object Model)是目前比较流行的软件开发技术之一,它是基于组件 模型的一种规范。本实验实际演示一个 COM 组件的应用,加深对 COM 组件理论知识的理解。为简单 起见,使用的是进程内 COM 组件,即 COM 的服务器和客户端在同一个进程中。 2 实验要求 本实验设计可以参照本人的论文《基于 COM 组件技术的研究》的内容,也是对本论文的实践检验。 相似之处不在赘述。总体要求是设计一个 COM 组件的服务器和一个客户端。服务器实现两个接口:数 字加法和字符串连接操作。 客户端是基于对话框的 MFC 程序, 有一个友好的界面来测试 COM 组件服务 器的功能。 3 实验平台和工具 Windows 操作系统、VC++6.0。 4 实验步骤 4.1 COM 服务器 为了方便本实验 COM 服务器实现使用的是 ATL(ActiveX Template Library)活动模板库,是一种 微软程序库,也是一套 C++模板库。使用 ATL 能够快速地开发出高效、简洁的代码,同时对 COM 组件 的开发提供最大限度的代码自动生成以及可视化支持。 COM 服务器的对象如下图 Object IUnknown IMath IStr 图 1 COM 服务器对象 具体的步骤如下: 1. 新建一个 ATL 工程 (Project) 。命名为 MyCom(如图 2),并选择 DLL 方式(如图 3)。 2 图 2 新建 ATL 工程 图 3 选择 DLL 说明: Dynamic Link Library (DLL) 表示建立一个 DLL 的组件程序。 Executable (EXE) 表示建立一个 EXE 的组件程序。 Service (EXE) 表示建立一个服务程序,系统启动后就会加载并执行的程序。 Allow merging of proxy/stub code 选择该项表示把"代理/存根"代码合并到组件程序中,否则 需要单独编译,单独注册代理存根程序。 Support MFC 支持 MFC Support MTS 支持事务处理,即是否支持 COM+ 功能。 2. 增加 ATL 对象类: 选择菜单 Insert\New ATL Object\Object 分类\Simple Object 项目 (见图 4) 。 3 图 4 选择建立简单 COM 对象 说明:Object 普通组件。其中可以选择的组件对象类型很多,但本质上,就是让向导帮忙加上一些 默认接口。 3. 增加自定义类 CMath(接口 IMath),见图 5。 图 5 填写类名 4. 填写属性接口,见图 6。 图 6 选择属性 4 5. 添加接口成员函数 图 7 调出增加接口方法的菜单 图 8 增加接口函数 Add 说明: [in]表示参数方向是输入; [out]表示参数方向是输出; [out,retval]表示参数方向是输出,同时可以作为函数运算结果的返回值。 一个函数中,可以有多个[in]、[out],但[retval]只能有一个,并且要和[out]组合后在最后一个位 置。 图 9 接口函数 5 实现代码如下: STDMETHODIMP CMath::Add(long n1, long n2, long * pnVal) { // TODO: Add your implementation code here * pnVal = n1 + n2; return S_OK; } 6. 添加第二个接口 IStr。 完成上述步骤后,打开 IDL 文件(双击 IMath 接口),手工添加代码,其中 UUID 的每个组件,每 个接口都会不同。在下面的代码中加入黑体部分: … //接口的完整描述 [ object, //表示本块描述的是一个接口 uuid(E34275D2-B3CA-4BCA-9AC7-0713ABE2F876), helpstring("IMath Interface"), //说明文字 pointer_default(unique) //定义接口函数中参数所使用指针的默认属性 ] interface IMath : IUnknown //接口 IMath 派生自 IUnknown { //接口函数列表 [helpstring("method Add")] HRESULT Add([in] long n1, [in] long n2, [out,retval] long * pnVal); }; //增加接口代码 [ object, uuid(36A75A3F-94DE-47fe-AF51-0C0C65316A03), // 手工产生的 IID h

3,245

社区成员

发帖
与我相关
我的任务
社区描述
ATL,Active Template Library活动(动态)模板库,是一种微软程序库,支持利用C++语言编写ASP代码以及其它ActiveX程序。
社区管理员
  • ATL/ActiveX/COM社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧