Download source code
I. Preface
1. It is basically consistent with the content in COM Component Design and Application (5. However, this article explains how to use it in vc.net 2003. Even if you no longer use vc6.0, compare it with the previous one.2. Except for the iunknown interfaces required by all COM components, the first component implements a self-defined
implementation. This facilitates development, testing, and maintenance. These small modules are components. Com is an object-oriented component model that supports inheritance and Data encapsulation. COM components are implemented based on COM specifications. The COM object is a collection of some functions, all of wh
COM Component Design and Application (11)Call of idispatch and dual InterfaceAuthor: Instructor Yang
Download source code
I. PrefaceSome time ago, due to busy work, I was not able to write in time. In the meantime, I received a letter from many netizens asking and encouraging me. I would like to express my gratitude to you here. Cough... I also need a job to support my family ......The previous response int
Interface} Example four, invoking a component using the #import method#import Way has been introduced in the seventh time, there is no more wordy. After you download the sample program, go to see it yourself. And be sure to master this method, because it is operating efficiency is the fastest ah.Iv. SummaryLeave your homework. In all the component programs we implemented before, only the interface method (function) was added, not the interface properties (variables), you practice it, very simp
implementation. It is only used to provide all connections from applications to controls.
3. Conclusion
This article discusses the development of a COM application based on the Windows CE platform, and puts forward the implementation of a serial communication control as an example. This control can be embedded in most Windows CE programs to complete the basic tasks of current serial communication.
At pr
in com? Do you want to know how to use Unicode ?...... ~~~, I can't tell you now, I tell you now, for fear that you are not impressed! And listen to the next decomposition ......
Note 1: CLSID = Class ID has introduced the functions for writing CLSID to a composite file: writeclassstg () and istorage: setclass (). NOTE 2: GUID is a globally unique identifier. CLSID/IID actually uses the guid concept. Note 3: progid = program id, equivalent
should I do? Delete the predefined macro "_ atl_min_crt "! For the operation method, see Figure 1 and figure 2. (This project attribute in vc.net 2003 is calledThe minimum CRT used in ATL ")
2-3 MBCS/UnicodeThis is not much to mention. In the predefined macros, _ MBCS or _ Unicode are used respectively.
2-4 IDL Compilation At the early stage of the design, COM set a goal to achieve cross-language calls. Since it is cross-language, the component i
do? Delete pre-defined macro "_ATL_MIN_CRT"! The operation method is also shown in figure I, figure ii. (The Project property in Vc.net 2003 is called "the smallest CRT in ATL")2-3 Mbcs/unicodeThis is not much to say, in the predefined macros, use _MBCS or _unicode respectively.Compilation of 2-4 IDLCOM in the early stages of design, a goal was set: to be able to implement cross-language calls. Since it is cross-lingual, the interface description of the component must be recognized in any local
: unresolved external symbol _ main" may be reported during compilation ". What should I do? Delete the predefined macro "_ atl_min_crt "! For the operation method, see Figure 1 and figure 2. (This project attribute in vc.net 2003 is called "minimum use of CRT in ATL ")
2-3 MBCS/UnicodeThis is not much to mention. In the predefined macros, _ MBCS or _ Unicode are used respectively.
2-4 IDL CompilationAt the early stage of the design, COM set a goa
Generally, we have met COM + ApplicationProgramThere are two catalog errors :( 1 ) The first is to open COM + An error occurred while executing the last operation due to a "catalog error" in the application, ErrorCode 8007042c- Dependent Services or groups cannot be started. events or logs contain other error and difficult information ".
The solution
each attribute actually corresponds to a private member of the class, and that the read-write of the attribute is implemented through both functions.
Each property has a red tag next to it, and by double-clicking the property, we can get the definition of the property, and we can see that the property can be a getting, Set, or Get/set.
4, the use of components
When we understand the metadata, the rest of the work is how to use this component in ASP.net, and here is a section of code that use
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
: progid = program id, equivalent to CLSID, is represented by a string.Note4: The registry subkeys progid and versionindependentprogid indicate that the real progid is not related to the version.Progid. For example, if Excel is installed on my computer, its progid = "Excel. application.9 ",Versionindependentprogid = "Excel. application ".Note 5: For memory management of the
COM Component Design and Application (10)Idispatch interface for vc.netAuthor: Instructor Yang
Download source code
I. PrefaceI finally wrote the tenth time, and I have been hoping to write this time. Why? Automation is a very common, useful, and wonderful com function. Since office software such as Word and Excel provide the "macro" function, even the VC develop
COM Component Design and Application (8)Implement multiple interfacesAuthor: Instructor Yang
Download source code
I. PrefaceFrom the fifth back to the seventh back, we wrote a simple COM component using ATL. The reason for simplicity is that only one custom (custom) is implemented in the component) ifun. Of course, if you want to be lazy, we can add all 200 funct
Thinner" the truth. Later, there are more books to buy, the Internet is more convenient and cheaper ...
In order to let Vckbase friends, no longer experience my past pain, no longer repeat my "headless fly" like the hardships of exploration, in order to vckbase the booming, for the Chinese software cause of take-off (bad, blown too high) ... I intend to save some time to earn points on the BBS, write a series of papers, called "COM Component design
A COM object of type ' Microsoft.Office.Interop.Word.ApplicationClass cannot be cast to an interface type ' Microsoft.office.interop.word._ Application ". This operation failed because of a COM component call to an interface with IID ' {00020970-0000-0000-c000-000000000046} ' QueryInterface failed because of an error loading the type library/dll. (Exceptions are
several times. Why don't I know it? Do you know how a bear died? (Note 5)4-4Because our components have been upgraded, we should also modify the version number (this is not necessary, but it is best to modify it ). Open the Registry file (. RGS) and change the version of progid "mathe.1" to "mathe.2 ". Modify the version and prompt text in the IDL file if you want. Here we will not paste the file content, because it is very simple. After you download the sample program (note 6), let's see it fo
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.