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
Currently, many video sharing websites, such as Tudou, use the flash control as the player interface. However, it is very simple to use flash to implement full screen. You only need to set the fullscreen attribute to true, other players, such as
We can see the following code in the header file atlbase. h:
//////////////////////////////////////// /////////////////////////////////////
// Connection point helpers
Atlinline atlapi atladvise (iunknown * punkcp, iunknown * punk, const IID & IID,
View a browser source implementation, found that the use of IE control, but the example did not find any code to create the IE browser Control, after careful tracking, found that the CAxWindow class can be so used drop.The third parameter is passed
Xinyi:
How to change the background color of the composite control:
Select the BackGroundColor attribute in the wizard.
After this attribute is selected, the wizard will add the m_clrBackColor member to our code, and the OnBackColorChanged detailed
Com -- Component Object Model (Component Object Model) is a set of software development methods and specifications proposed by Microsoft. It also represents a software development idea, that is, the idea of component-oriented programming.COM
first, implement the idochostuihandlerdispatch interface implements
Class program cmyuihandler: Public Program , public ccomcoclass , public idispatchimpl {public: ccomqiptr m_spextdispatch; public: cmyuihandler () {} invoke () invoke
use idispeventimpl or idispeventsimpleimpl for idispeventsimpleimpl, you need to prepare a idispeventimpl data structure, and use sink_entry_info for idispeventimpl, you must specify Lib, version number, and other information. Use macro
in one case, the COM component is like this. class atl_no_vtable cmath: Public ccomobjectrootex
,
Public ccomcoclass
,
Public imath,
Public iadvancedmath
{...
}
cmath is defined by the user, but
The out-of-process server is a long file name, which is converted to the 8.3 format during registration. As a result, it does not match the long file name recorded in appid, and dcomcnfg bypasses the access permission set for appid
Class MyObject1 { public: virtual void Func1 (){}; private: int m_a; int m_ B; }; class MyObject2 { public: virtual void Func2 () {}; private: int m_a; int m_ B; }; class Drive: public MyObject1, public MyObject2 {
Use Dialog as an Example
Caboutdlg DLG;
DLG. domodal ();
Class caboutdlg: Public cdialogimpl {...}
When you execute
Return: dialogboxparam (_ atlbasemodule. getresourceinstance (), makeintresource (static_cast (this)-> IDD ),
Hwndparent, T:
This error occurs when a cbuttonst class is compiled today. It is mainly about Unicode. To solve this problem, due to programming habits, we may not pay attention to Unicode and ANSI processing during programming. Here are several suggestions:
1.
After the previous blog on ActiveX controls, I have added some more questions.
How to compile a secure ActiveX Control
ActiveX control, which is often blocked or prompted due to security permissions of IE browsers during JS calls,
Let's take a
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.