ATL is convenient and quick to create components, but the internal structure hierarchy is complex and many template classes are used. I simplified the analysis principles.
The component implements a specific interface. for creation, basic lifecycle management, and interface query, the macro or parent class should be processed as much as possible.
The internal object xobj of each component is used for creation.
You can create an MFC console program and
For components generated by ATL, it is easy to implement multiple interfaces (whether through methods that inherit multiple interfaces or through internal classes). How can this problem be achieved, the key is to manage the life cycle and creation of components, and support for multi-interface queries by components.
The following figure shows the simulated classes that implement multiple interface components for multiple inheritance and internal class
There are a large number of Macros in ATL. When you look at them, they are all big, but there are still rules to follow. The key is to grasp the two tables. The first is the object table, which is defined by the following macro group:
Begin_object_map
Object_entry
End_object_map
This group of macros defines the COM Object table. Through this table, com can easily create corresponding COM Objects Based on clsid.
The other table is an interface tab
# Include
Everyone may think that t2bstr, w2t, and other Macros in ATL are very convenient.But be careful, because:They allocate memory from the stack and call alloca internally. The function allocates the memory of the returned string from the stack, and the memory will not be released until the function is called to return.If such macros are repeatedly called for tens of thousands of times in a loop, you will inevitably generate stack overflow! Ho
Referenced from:The description of the image in HTML. Can the ATL parameter be displayed by branch?
Http://topic.csdn.net/t/20040904/21/3340893.html
IMG SRC
=
Img.jpg alt
=
"
1111111 bbbbbbbbbb
"
>
How can I disable the browser from displaying "X" when the SRC address of IMG is incorrect"
Http://topic.csdn.net/t/20060913/10/5018384.html
IMG ID
=
"
AA
"
SRC
=
"
Aa.jpg
"
Onerror
=
"
This.sr
Introduced
In this series of tutorials, I'll discuss some of the internal ways that ATL works and the techniques it uses.
At the beginning of the discussion, let's take a look at the memory distribution of a program. First, write a simple program that does not have any data members and you can look at its memory structure.
Program 1.
#include using namespace std; class Class { }; int main() { Class objClass; cout cout return 0; }
The outpu
Write an ATL component, add a simple class, and add in the class header file:BEGIN_CATEGORY_MAP(CAirlineInfo) IMPLEMENTED_CATEGORY(CATID_SafeForScripting) IMPLEMENTED_CATEGORY(CATID_SafeForInitializing) END_CATEGORY_MAP()
The header file (#include
Publishing on the web requires that the dependent files be packaged as. cab, which includes the Dll,dll dependent libraries and an INF file for the component. The contents of the INF file in my example ar
The Component Object model is written with the ATL implementation article, but a key problem is missing. There is also a need to modify the atlcom.h file where I put it more here. Open the atlcom0.h that was corrected by the previous article and find the following function:
Stdmethodimp Ienumonstlimpl
Corrected to (only need to change the bold place, a word only)
hr = Copy::copy (pelt, *m_iter);
To
hr = Copy::copy (pelt, *m_iter);
The complete f
. operator, but also with the operator:The. operator is the smart pointer class that calls its own method, with the operator called the method that contains the interface, because the smart pointer class has a variable m_pinterface used to store the contained interface, essentially Pwiseptr.m_pinterface->method ().Advantages of smart pointers:1. When we call CreateInstance () to generate an interface implementation class object, the smart pointer is automatically called a _release () Private fun
http://www.51zxw.net/study.asp?vip=1368926
A full Windows service source code download address
Development Environment VS 2010 (but the method applies to VS2005 and VS 2008) C + + ATL edition
After the EXE is compiled, use the batch processing under Release to load and unload the serviceStart and stop operations for services in the Service Control Panel in WindowsThis program is a complete Windows Service development framework, directly inside the Add
Introduced
In this series of tutorials, I'll discuss some of the internal ways that ATL works and the techniques it uses, this is the second article in this series.
Now let's explore some of the more interesting data behind virtual functions. In order to be consistent with the above, I will use the same sequence in the discussion in this article, and the sequence of the program starts at 20.
Let's look at the following program:
Program 20.
#inclu
Problem Background: onlongclick and onclick listeners are set for a button. To achieve the camera to take a photo, the first long click to focus, the second click to take the photo effect. Onlongclick is executed by a separate thread. If false is
Small demo, with JS capture keyboard disk Press the key, and then show the corresponding code value
Press the key on the keyboard, The text box displays the corresponding code
The above mentioned is the entire content of this
Phpmailer php e-mail
Everyone is great! I met a very bitter letter issue, first put the details of the problem
SMTP, from Server:250-m1.mydomain.com250-pipelining250-size 15728640250- vrfy250-etrn250-starttls250-enhancedstatuscodes250-8bitmime250
On the surface, many people look at the old practices. In fact, their hearts are better than others, self-confidence, vanity, and even sinister. I am used to seeing more at work.
Some people write everything on their faces. On the surface, they
From August to October, I had read a lot of technical books, including some of the award-winning works of the latest 8th Mao Dun literature Award. The major failures of economic management, haidilao, Liu Xiu of literature and history, Cao, and some
Resin3.1.9 & solr1.4.1 can be downloaded from the official website.
Install resin:
tar xzvf resin-version.tar.gzcd resin-version ./configure --prefix=/opt/resin \--enable-lfs \--with-java-home=/path/to/your/jdkmake make install
Configure SOLR:
cp
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.