`
huobengluantiao8
  • 浏览: 1050564 次
文章分类
社区版块
存档分类
最新评论

Using the ATL COM AppWizard

 
阅读更多
Using the ATL COM AppWizard

To create a project using the ATL COM AppWizard

  1. Open Visual C++. Click New on the File menu and click the Projects tab.

  2. Choose ATL COM AppWizard as your application type.

  3. Enter a project name.

  4. Click OK.

The ATL COM AppWizard displays a dialog box showing options that apply to your ATL project:

  • Choose from one of three server types: Dynamic Link Library (DLL) for an in-process server, Executable (EXE) for a local out-of-process server, or Service (EXE), which is a Windows NT application that runs in the background when NT starts up.

  • Select the Allow merging of proxy/stub code check box as a convenience when marshaling interfaces is required. This option places the MIDL generated proxy and stub code in the same DLL as the server.

  • Select the Support MFC check box (available for DLL projects only) to use MFC functionality (such as CString) in your server.

  • Select the Support MTS check box to modify the project build settings to support the Microsoft Transaction Server. For more information on adding MTS support to your project, see MTS Support in ATL Projects.

Click Finish to generate the project. The AppWizard then displays information about the project that it is creating and then displays the newly created project in the Project Workspace.

NoteWhen you build your project, you can choose a MinSize or MinDependency configuration. MinSize will generate a smaller component, since shared code will be used from Atl.dll. In this case, you must distribute Atl.dll with your component. MinDependency will generate a larger component, since all necessary code will be linked in with your component.

NoteWhen building a Release version of a project, you can get the following link error:

LIBCMT.LIB(crt0.obj) : error LNK2001: unresolved external symbol _main

This error occurs if you are using CRT functions that require CRT startup code. The Release configurations define _ATL_MIN_CRT, which excludes CRT startup code from your EXE or DLL. To avoid this error, do one of the following:

  • Remove _ATL_MIN_CRT from the list of preprocessor defines to allow CRT startup code to be included. On the Project menu, click Settings. In the Settings For: drop-down list, choose Multiple Configurations. In the Select project configuration(s) to modify dialog box that appears, click the check boxes for all Release versions, and then click OK. On the C/C++ tab, choose the General category, then remove _ATL_MIN_CRT from the Preprocessor definitions edit box.

  • If possible, remove calls to CRT functions that require CRT startup code and use their Win32 equivalents. For example, use lstrcmp instead of strcmp. Known functions that require CRT startup code are some of the string and floating point functions.
分享到:
评论

相关推荐

    A Simple COM tutorial using ATL使用ATL简单COM指南

    8. ** 源码**:压缩包中的`COM_ATL_Tutorial_Source.zip`、`COM_ATL_Tutorial_VC_Source.zip`和`COM_ATL_Tutorial_VB_Source.zip`分别可能包含C++、Visual C++以及Visual Basic的示例代码,用于演示如何在这些环境中...

    COM Programming by Example Using MFC ActiveX ATL ADO and COM+

    ### COM Programming by Example Using MFC ActiveX ATL ADO and COM+ #### 一、概述 《COM Programming by Example Using MFC ActiveX ATL ADO and COM+》是一本专注于讲解Component Object Model(组件对象模型...

    COM Programming by Example - Using MFC ActiveX ATL ADO and COM+

    《COM Programming by Example - Using MFC ActiveX ATL ADO and COM+》是一本面向实践的COM编程指南,由John E. Swanke撰写,并由R&D Books出版社出版。本书区别于传统COM理论书籍的地方在于它更注重通过实际案例来...

    ISAPI_using_ATL.zip_ATL_ATL Server ISAPI

    ATL(Active Template Library)是微软提供的一套C++模板库,主要设计用于快速构建COM(Component Object Model)组件。ATL Server是ATL的一个扩展,特别针对Web服务开发进行了优化,提供了更简洁、高效的API来创建...

    VC ATL COM 入门实例教程

    VC ATL COM 入门实例教程 本教程旨在指导 VC++ 新手程序员使用 ATL 创建一个 COM 服务器,并使用 Visual C++ 和 Visual Basic 程序来分别调用这个服务器。下面是从这个教程中总结的知识点: 1. 使用 ATL COM ...

    An Appwizard to Generate Non-COM Projects that can use ATL O

    总的来说,"An AppWizard to Generate Non-COM Projects that can use ATL O"是一个非常有用的工具,它让开发者能够在非COM环境中利用ATL的优势,如高效、轻量级的对象模型,而无需承担COM的复杂性。通过atlconwz....

    ATLCOM组件开发完整实例

    ATL com 组件开发完整实例,需要的可做参考。ATL,Active Template Library活动(动态)模板库,是一种微软程序库,支持利用C++语言编写ASP代码以及其它ActiveX程序。通过活动模板库,可以建立COM组件,然后通过ASP...

    GPS and Web Service using C++ ATL/WTL

    标题 "GPS and Web Service using C++ ATL/WTL" 指涉的是一个使用C++编程语言,结合ATL(Active Template Library)和WTL(Windows Template Library)开发的项目,该项目专注于在Windows Mobile 6.0及更高版本上...

    VC-ATL-COM-.rar_ATL com _com atl_vc ATL COM_vc atl

    **VC++ ATL COM 技术详解** ATL(Active Template Library)是Microsoft为Visual C++开发的一个库,它提供了一套模板类,用于简化COM(Component Object Model)组件的创建。ATL使得开发者能够快速、高效地构建轻量...

    ATL 2013 ,纯静态版本的ATL

    http://blogs.msdn.com/b/vcblog/archive/2013/08/20/atl-and-mfc-changes-and-fixes-in-visual-studio-2013.aspx One of the major changes we made was to eliminate the ATL DLL altogether. All ATL code is ...

    ATL开发与COM原理

    ATL(Active Template Library)是微软提供的一种C++库,用于简化COM(Component Object Model)组件的开发。COM是微软的二进制标准,它定义了一种对象间交互的规范,使得不同语言、不同进程甚至不同计算机上的软件...

    Developer's Workshop to COM and ATL 3.0

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

    COM_ATL 介绍

    COM_ATL,全称为Component Object Model - Active Template Library,是微软提供的一种轻量级的COM(组件对象模型)实现库,主要用于简化COM组件的开发。COM是一种二进制标准,允许不同应用程序之间的对象交互和互...

    COM+ programming [electronic resource] : a practical guide using Visual C++ and ATL

    This book offers a rapid introduction to the traditional COM framework, but spends most of its rigor on the services of COM+. Example code is clear, concise, and most of all, consistent. Many of the ...

    VC6.0_ATL_COM.rar_ATL_COM 组件_atl com vc6_com atl_vc6.0 ATL

    ATL (Active Template Library) 是Microsoft为Visual C++开发的一个库,主要目的是简化COM(Component Object Model)组件的创建。VC6.0是Microsoft Visual Studio 6.0的简称,这是一个较早版本的集成开发环境,广泛...

    ATL com组件创建和调用.zip

    ATL (Active Template Library) 是微软提供的一种C++库,用于简化COM(Component Object Model)组件的开发。COM是微软的二进制兼容标准,它允许不同语言编写的对象之间进行交互。ATL的设计目标是小巧、高效,使得...

    使用VC++编写ATL COM和测试COM

    ATL COM是微软Active Template Library (ATL)的一部分,它是一种轻量级的库,用于简化在Microsoft Visual C++(VC++)环境中创建COM(Component Object Model)对象的过程。ATL设计的目标是提供一个高效、小巧且易于...

    ATL基本使用.doc

    - 在项目类型列表中选择"ATL COM AppWizard",这将引导你创建一个ATL工程。 - 输入工程名称并点击"OK",接着进入AppWizard对话框。 在AppWizard对话框中,你可以配置COM服务程序的类型: - 动态链接库(DLL):...

    MFCATL示例 在MFC服务器中使用ATLCOM对象

    而ATL(Active Template Library)是另一套C++库,主要用于创建高效、小巧的COM(Component Object Model)对象。MFCATL示例主要展示了如何在MFC服务器中集成和使用ATL COM对象,以实现更灵活和高效的编程。 **1. ...

    The ATL OLE DB Provider templates only seem to support read-

    The ATL OLE DB Provider templates only seem to support read-only rowsets and making them support updating of data isn’t as easy as you’d expect!只读数据库模板

Global site tag (gtag.js) - Google Analytics