COM application Framework 1.2 design test version A

Source: Internet
Author: User
Tags documentation

This article only describes the main design parts of the COM application framework, and more, more detailed documentation is available in the download package for documentation and source code.

First, design instructions

The COM application framework is designed to use COM technology for standard Microsoft Windows multiple document processing applications. So the need for multiple document processing applications is not written more. If you are not aware of this, see MSDN or other books on the basics of programming.

The COM application framework is divided into two types, one is the COM multi-document application framework and the second is the single document application framework. Here we only introduce a multiple-document application, not a single document application.

The COM application framework is built in a separate AIFrame.DLL file, and all functions are operated through COM interfaces. The COM application framework will be designed using a combination of the following two libraries, 1. Using the Mfc+atl combination, 2. Using the Wtl+atl combination, the following is a description of the advantages and disadvantages of the two combinations, and finally the optimal combination is selected.

1. Use Mfc+atl Combination chart:

2. Use WTL+ATL Combination chart:

It's easy to see from the two drawings above that the COM application framework is developed using the MFC+ATL combination, where MFC has a layer of function calls, and code execution slows down.   Small programs may not be visible, large programs are obvious. If you develop a COM application framework using the WTL+ATL combination, there will be no more calls, and the code executes very quickly, just as it does with the Win32 SDK, because WTL is the template code and there is no one-layer function call after compilation. So the COM application framework will be designed using a WTL+ATL combination, which may be the best solution.

Second, the general design

1. Data View

The so-called Data view, is added to the "COM application framework" Every window, no matter what the window is used for, or what shape, collectively referred to as the Data view.

The data Views added to the COM application framework by all client programs must inherit from the Idataview pure virtual interface and must be. This will make the COM application framework work properly.

Data View pure Virtual interface: Idataview. The parent class is IDispatch.

2. Response function of command

Function name: NotifyCommand (UINT codenotify, UINT CmdID, Variant_bool *bhandle);

Parameters: codenotify-Notification code, not currently in use.

cmdid– a command ID, either a menu or a button in the toolbar.

bhandle– If the command also continues down the path set to VARIANT_TRUE, no downward path is set to VARIANT_FALSE.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.