Using the ATL COM AppWizard

原创 2012年07月23日 07:49:22
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.

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

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

ATL COM appWizard

2010-12-03 15:09ATL,Active Template Library活动模板库,是一种微软程序库,支持利用C++语言编写ASP代码以及其它ActiveX程序。通过活动模板库,可以建立...

Using User Defined Types in COM & ATL

By ioannhs_s, 18 Jan 2001   4.80 (86 votes)   ...

This page needs work The Complete Blanks Guide To Using The OGRE SDK AppWizard

Table of contents IntroductionGet ItInstall It OGRE SDKOGRE AppWizard Windows 95/98/200...

GPS and Web Service using C++ ATL/WTL

  • 2011年10月31日 13:29
  • 74KB
  • 下载

VC++ 的MFC 和ATL 及COM 是什么?

一、什么是MFC         微软基础类(Microsoft Foundation Classes),实际上是微软提供的,用于在C++环境下编写应用程序的一个框架和引擎,VC++是WinOS...
您举报文章:Using the ATL COM AppWizard