Specific functions of uses_conversion in ATL
ATL: conversion macros are a convenient way to convert various character encodings. They are very useful in function calls. The name of the ATL conversion macro is the [Source Type] 2 [New Type] or [Source Type] 2C [New Type] named according to the following pattern. According to the second form, the macro conversion
When using CString in ATL, you will be prompted to use wtl::cstring, (since WTL also has CString, but is not officially supported, it is best to makeWith the implementation of ATL) and we only need to use atl::cstring, this time only need to add the following 2 sentences in the stdafx.h header file:Note Using atl::cstr
7. com_interface_entry_autoaggregate (IID, punk, CLSID) parameter ATL routine commap
Let's take a look at the macro definition:# Define com_interface_entry_autoaggregate (IID, punk, CLSID )/{ IID ,/(DWORD) _ ccomcachedata (DWORD) offsetof (_ commapclass, punk )/>: Data ,/_ Cache },Let's take a look at its typical usage:Class cautoagg:Public idispatchimpl,Public isupporterrorinfo,Public ccomobjectroot,Public ccomcoclass{............};Similar to gener
Subject: hresult func4 ([out] BSTR * pval) in ATL; why can't I return the value for a call? Is JavaScript not supported?
Http://topic.okbase.net/200902/2009020414/3557980.html
Subject: hresult func4 ([out] BSTR * pval) in ATL; why can't I return the value for a call? Isn't JavaScript supported?Author: SunReply times: 5Published at: 14:47:38Body content:The webpage is called using JavaScript.OCX.
In the VC environment, you can use MFC to create a dialog box. You can also use the ATL class to create a dialog box.
The ATL class uses the features of the template class to generate a new class. Next we will introduce this step.
First, just like creating a dialog box program in MFC, you need to create a resource file, that is, creating a dialog box resource. This can be completed in VC resource file edi
Chapter II Transformation of one of the simplest window programs
I know, there may be a lot of friends on the last chapter of "Hello, world!" The ATL version disagrees because it's not an ATL program-after all, it's just a ccommodule. But anyway, I would say that it almost still has all the components of an ATL GUI program: Portal, initialization, program body,
see the following: Class Atl_no_vtable CPolyCtl: ... public iobjectsafetyimpl in ATL 3.0, the implementation of IObjectSafetyImpl has changed so that it can be used as a template parameter now to provide security options. For example, the class declaration above will appear as Class atl_no_vtable CPolyCtl: ... Public iobjectsafetyimpl and you do not need to rewrite two methods. For additional information, click the following article number to vi
Engineering Structure of table ATL
File Name
Description
Projectname. cpp
It is the main project file. It contains the support functions required by COM, which are used to provide host files for your components.
Projectname. h
The interface declaration of the component in the host file. The midl compiler automatically generates the file.The IDL file of the compilation project is used to generate the file.
link of two networks at the same time, when a control calls the imediacontrol: Stop () method twice, it will go to the above breakpoint, and the two entries are respectively the stop () method of the RTP-MP4 filter module in the two controls. This phenomenon should be said that the graph in a control will call the stop () method of the RTP-MP4 filter module in the graph in another control, this is a strange phenomenon, is there any particular emphasis on the delivery of dshow graph messages in
The macro in ATL defines the analysis of offsetofclass, atloffsetofclassRecently, I learned how to use ATL to solve the problem of defining the offsetofclass macro, analyzing the virtual function table by the way, and calling the function through the virtual function table.1. Solve the macro definition of offsetofclass in ATL # define _ ATL_PACKING 8 # define off
Server code certificate ------------------------------------------------------------------------------------------------------------------------------------------------------------ Altstopwatch. IDL [interface definition file] // Altstopwatch. IDL: IDL source for altstopwatch // This file will be processed by the midl tool to // produce the Type Library (altstopwatch. TLB) and handle alling code. import "oaidl. IDL "; import" ocidl. IDL "; [object, UUID (FD2BE6F3-9074-47F3-9884-FDD3DE13D158)
This article translated several articles and briefly introduced ATL catlregexp, Greta, boost: RegExSuch as regular expression library, these Expression Libraries allow us to easily take advantage of the great power of the Regular Expression Library, to facilitate our work.
Regular expression syntax
Character Element
Meaning
.
Match a single character
[]
Specifies a character class that matches any character in squar
All the conversion macros provided by ATL are defined in the header file A2cw (lpcstr)-> (lpcwstr)
A2w (lpcstr)-> (lpwstr)
W2ca (lpcwstr)-> (lpcstr)
W2a (lpcwstr)-> (lpstr)
All macros are shown in the following table:
A2bstr
Ole2a
T2A
W2a
A2cole
Ole2bstr
T2bstr
W2bstr
A2ct
Ole2ca
T2ca
W2ca
A2cw
Ole2ct
T2cole
W2cole
A2ole
Ole2cw
T2cw
W2ct
A2t
Ole2t
I reported the following error when I used the ATL function a2w in MFC:Error c4430:missing type Specifier-int assumed. Note:c++ does not support Default-int"Workaround"Https://www.xuebuyuan.com/1194846.html:-----------------------The computer configuration that is experiencing this problem is Windows 7 32-bit +visual Studio SP1Workaround 1:General-Use dynamic ATL, configuration settings, settings, projectWo
[C ++] zlatlcv: Auxiliary library for ATL String Conversion. Can easily convert the UTF-8 string to a string such as TCHAR, zlatlcvtchar
Author: zyl910
Today, UTF-8 strings are increasingly used. But in VC, you cannot directly process the UTF-8 string, you have to specifically write UTF-8 and narrow string, wide string, TCHAR String Conversion code. It is not only time-consuming and laborious, but it is easy to cause memory leakage if you do not pay
(FD3216FD-B513-40F1-BE2C-72B2954D1368), helpstring ("help string stopwatch class")] coclass stopwatch {[default] interface Istopwatch ;};};
Stopwatch. h [interface definition header file]
// stopwatch.h : Declaration of the Cstopwatch#pragma once#include "resource.h" // main symbols#include "altstopwatch_i.h"#if defined(_WIN32_WCE) !defined(_CE_DCOM) !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA)#error "Single-threaded COM objects are not properly supported on Windows CE platform,
1. Open vs2010 and create an atl com project, such as 1
2. Select[Support for COM + 1.0] and [Support for Part registrars]
3. added a com project and right-click the project name to add a class, as shown in figure
Open the following window and select an ATL simple object.
In the following window, enter the class name firstclass In the abbreviation column. Other input boxes are automatically filled in, a
, locale_system_defaultdispid far * rgdispid // returns the queried interface function ID array); invoke function hresult invoke (dispid dispidmember, // interface function ID refiid riid, // reserved parameter, iid_nulllcid lcid, // language idword wflags, // type of the interface function dispparams far * pdispparams, // parameter variant far * pvarresult of the function, // The Return Value of the function is reset info far * pexcepinfo, // the error message unsigned int far * puargerr // err
Component Object Model and ATL implementation Addendum
Cheungmine
2007-10-11
The component object model and the ATL implementation document have been written, but a key issue is missing. There is another place where you need to modify the atlcom. h file. I will change it here. Open atlcom0.h after correction in the previous article and find the following function:
Stdmethodimp ienumonstlimpl
Correct it to
Recently compiled a DLL using ATL, which always appears during compilation."Nafxcwd. Lib (dllmodul. OBJ): Error lnk2005: _ dllmain @ 12..." error!Later, we found that when we created the DLL, we did not use MFC. Later, we added something related to MFC in the project, which caused the above problem.Follow these steps to solve the problem:1. Change the project settings to "dynamic use of MFC"2. on the C ++ settings page, you can see that _ usrdll and _
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.