`
java-mans
  • 浏览: 11427463 次
文章分类
社区版块
存档分类
最新评论

USES_CONVERSION

 
阅读更多

ATL 中 USES_CONVERSION 的具体功能

ATL:转换宏是各种字符编码之间进行转换的一种很方便的方式,在函数调用时,它们显得非常有用。ATL转换宏的名称是根据下面的模式来命名的[源类型]2[新类型]或者[源类型]2C[新类型]。据有第二种形式的名字的宏的转换结果是常量指针(对应名字中的"C")。

为了使用这些宏,需要先包含atlconv.h头文件。你甚至可以在非ATL工程中包含这个头文件来使用其中定义的宏,因为这个头文件独立于ATL中的其他部分,不需要一个_Module全局变量。当你在一个函数中使用转换宏时,需要把USES_CONVERSION宏放在函数的开头。它定义了转换宏所需的一些局部变量

在 mfc 下使用要包含 afxconv.h
atl 下是 atlconv.h
-------------
调用 USES_CONVERSION; 之后就可以使用 OLE2T 等转换的宏。


ATL 中 USES_CONVERSION 的具体功能

ATL:转换宏是各种字符编码之间进行转换的一种很方便的方式,在函数调用时,它们显得非常有用。ATL转换宏的名称是根据下面的模式来命名的[源类型]2[新类型]或者[源类型]2C[新类型]。据有第二种形式的名字的宏的转换结果是常量指针(对应名字中的"C")。

为了使用这些宏,需要先包含atlconv.h头文件。你甚至可以在非ATL工程中包含这个头文件来使用其中定义的宏,因为这个头文件独立于ATL中的其他部分,不需要一个_Module全局变量。当你在一个函数中使用转换宏时,需要把USES_CONVERSION宏放在函数的开头。它定义了转换宏所需的一些局部变量

在 mfc 下使用要包含 afxconv.h
atl 下是 atlconv.h
-------------
调用 USES_CONVERSION; 之后就可以使用 OLE2T 等转换的宏。

分享到:
评论

相关推荐

    移位差影快速定位分割算法

    STDMETHODIMP CPalmTexture::CropShiftSubtraction(BSTR imagePalm, BSTR image... USES_CONVERSION; ImageFileR = OLE2T(imagePalm); TCHAR *ImageFileS; //USES_CONVERSION; ImageFileS = OLE2T(imageCrop);

    汉字区位码查询换算程序

    USES_CONVERSION; char *pBuffer = W2A(str); int i = 0; while(pBuffer[i] != '\0') { TRACE(L"%d\n", pBuffer[i]); i ++; } //判断是否含有非中文字符 if(i != str.GetLength() * 2) { pBuffer = NULL; ...

    简易的播放器

    USES_CONVERSION; fp = fopen(W2A(m_soundfile.GetBuffer(m_soundfile.GetLength())),"rb"); if(NULL == fp) { MessageBox(L"打开所所定的播放文件失败,请确认文件是否存在!"); return; } fseek(fp,20,...

    Linq学习100例(含源代码)

    This sample shows different uses of Conversion Operators LINQ - Miscellaneous Operators This sample shows different uses of Miscellaneous Operators LINQ - Custom Sequence Operators This sample...

    GoogleMap plot-google​-map 源码

    It assumes the coordinates of the current figure are in the WGS84 datum, and uses a conversion code to convert and project the image from the coordinate system used by Google into WGS84 coordinates. ...

    Spectral Core Full Convert Enterprise v6.11.0.1683

    Uses bulk insert modes of target databases wherever possible Built-in Scheduler for recurring conversions Easy to use modern interface Database explorer Table data viewer and editor Command-line ...

    Optical Wavelength Filter Using Mode Conversion in Multimode Waveguide

    A wavelength filter with simple structure using multimode waveguide is proposed. The device uses mode conversion by a grating structure fabricated simultaneously with the multimode waveguide.

    labview_心电控制_心跳曲线_心跳检测

    上位机使用LABVIEW显示心跳曲线, USB采集,单片机采用STM32F103C8,心跳检测芯片采用AD8232,利用单片机自身AD转换(The upper computer ... heartbeat detection chip uses ad8232, SCM uses its own ad conversion)

    matlab导入excel代码-utl_spectral_density_wav_file:计算WAV声音文件的频谱密度。关键字:sassql

    matlab导入excel代码utl_spectral_density_wav_file 计算WAV声音文件的频谱密度。...conversion of wave file to SAS dataset ) proc spectra is not part of base WPS ERROR: Procedure SPECTRA n

    ACMConvertor_mp3wav_wave_

    This source code included TACMConvertor and uses it for mp3 to wave file conversion. TAudioInfo used to read from mp3 and TWaveFileWrite used to write to wave file.

    vlmcsd-1113-2020-03-28-Hotbird64.7z

    If you do not use -N0 or -N1 to force disable/enable the NDR64 protocol, vlmcsd now uses the host build to decide if it uses NDR64 depending if a genuine KMS is using NDR64 on that build.

    periph_adc.rar

    The ADC example uses the internal temperature sensor as an input to channel 0 and converts the analog voltage to a digital value. The conversion is done at 3Hz and the output value is display on the ...

    100Base-T1-Media Converter NXP, from Technica Engineering, BMW 宝马10年合作伙伴

    The 100BASE-T1 MediaConverter_NXP establishes one direct point-to-point conversion between automotive ECU’s using 100BASE-T1 and any standard Fast Ethernet device with RJ-45 connector. No packets ...

    adaptive_MPC_Control

    % low conversion rate to high conversion rate. % % A discrete time ARX model is being identified online by the Recursive % Polynomial Model Estimator block at each control interval. The adaptive % MPC...

    智能影院Smart Movie 破解版for syban s60 v5

    03. Player uses the phone screen in portrait or landscape mode, utilizing the full screen size of the device 04. Rescaling of video to utilize the full screen area 05. Support for subtitles - allowing...

    Senfore_DragDrop_v4.1

    directory which automates the conversion process. The C++ Builder demo forms are distributed in binary format. 7) If upgrading from a previous version of the Drag and Drop Component Suite, please ...

    模数转换adc

    A/D converter uses the successive-approximation conversion technique featuring a high-impedance threshold detector, a switched capacitor array, a sample-and-hold, and a successive- approximation ...

    Analysis on FM-to-AM conversion of SSD beam induced by etalon effect in a high-power laser system

    FM-to-AM (frequency modulation-to-amplitude modulation) conversion caused by nonuniform spectral transmission of broadband beam is harmful to high-power laser facility. Smoothing by spectral ...

    Delphi HGE 1.7

    ** Delphi conversion by Erik van Bilsen *) interface uses Classes, Windows, DirectXGraphics, Bass, OpenJpeg, Graphics, D3DX81mo; (******************************************************************...

    UnityModules-Release-CoreAsset-4.3.4.zip

    Fixed bug where graphic renderer inspector would fail when the user uses unpacked sprites. Added callouts to notify users that unpacked sprites are not supported in the Graphic Renderer. Added a new ...

Global site tag (gtag.js) - Google Analytics