EZInotes
SEARCH
ezinotes
COM+ / DCOMCOM+ / DCOM


COM+ / DCOM  >>  How to create new component
How to create new component

How to create new component



FileName Description Size
Source code. ComNew.zip Source code. 114 kB

Follow these steps to create new COM component:
  • Run Microsoft Visual C++ 6.0 and start new project.
  • Select ATL/COM.
  • ...
Start new project in Visual C++ 6.0.
Start new project in Visual C++ 6.0.

Select project type and name.
Select "ATL COM AppWizard" project type. Enter project name and click OK.

ATL COM Wizard.
Select "Dynamic Link Library (DLL)" and check "Support MFC" and "Support MTS".

Add New ATL Object.
Select class amd Add New ATL Object.

Select MS Transaction Server.
Select MS Transaction Server.

Name ALT object.
Enter name for ALT object.

Select some MTS additional attributes.
Select MTS tab. Check "Support IObjectControl" and "Can be pooled".

Select CComNewLogic.
Select CComNewLogic.

Change Single to Multi threaded and add comment.
Change Single to Multi threaded (CComMultiThreadModel) and add comment before DECLARE_NOT_AGGREGATABLE.

Select IComNewLogic.
Select IComNewLogic.

Enable Transaction Required.
Enable Transaction Required. Add #include <mtxattr.h>. And TRANSACTION_REQUIRED.

Add new COM Method.
Add new COM Method.

Add new COM Method name and parameters.
Add new COM Method name and VARIANT parameters as seen on the picture.

Select debug mode and MyTestMethod.
Select debug mode and MyTestMethod.

Add code to MyTestMethod.
Add code to MyTestMethod.

Build ComNew.dll.
Build ComNew.dll.

Build ComNew.dll succeeded.
Build ComNew.dll succeeded.

Location of ComNew.dll in File Manager.
Location of ComNew.dll in File Manager.

Build release version of ComNew.dll.
Build release version of ComNew.dll.

Set "Use MFC in a Static Library" for release build.
Set "Use MFC in a Static Library" for release build.

Home |  Sitemap | Copyright © 1991-2007 EZInotes