<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>https://wiki.shelek.ru/index.php?action=history&amp;feed=atom&amp;title=FAQ%3AWinAPI_VCPP%3A%D0%BF%D0%B5%D1%80%D0%B5%D0%B2%D0%BE%D0%B4_%D0%BC%D0%B5%D0%B6%D0%B4%D1%83_BSTR_%D0%B8_CString</id>
		<title>FAQ:WinAPI VCPP:перевод между BSTR и CString - История изменений</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.shelek.ru/index.php?action=history&amp;feed=atom&amp;title=FAQ%3AWinAPI_VCPP%3A%D0%BF%D0%B5%D1%80%D0%B5%D0%B2%D0%BE%D0%B4_%D0%BC%D0%B5%D0%B6%D0%B4%D1%83_BSTR_%D0%B8_CString"/>
		<link rel="alternate" type="text/html" href="https://wiki.shelek.ru/index.php?title=FAQ:WinAPI_VCPP:%D0%BF%D0%B5%D1%80%D0%B5%D0%B2%D0%BE%D0%B4_%D0%BC%D0%B5%D0%B6%D0%B4%D1%83_BSTR_%D0%B8_CString&amp;action=history"/>
		<updated>2026-05-27T09:24:59Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.25.1</generator>

	<entry>
		<id>https://wiki.shelek.ru/index.php?title=FAQ:WinAPI_VCPP:%D0%BF%D0%B5%D1%80%D0%B5%D0%B2%D0%BE%D0%B4_%D0%BC%D0%B5%D0%B6%D0%B4%D1%83_BSTR_%D0%B8_CString&amp;diff=710&amp;oldid=prev</id>
		<title>RXL в 12:24, 3 октября 2009</title>
		<link rel="alternate" type="text/html" href="https://wiki.shelek.ru/index.php?title=FAQ:WinAPI_VCPP:%D0%BF%D0%B5%D1%80%D0%B5%D0%B2%D0%BE%D0%B4_%D0%BC%D0%B5%D0%B6%D0%B4%D1%83_BSTR_%D0%B8_CString&amp;diff=710&amp;oldid=prev"/>
				<updated>2009-10-03T12:24:12Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 12:24, 3 октября 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L1&quot; &gt;Строка 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Как корректно перевести тип BSTR в CString и наоборот?===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Как корректно перевести тип BSTR в CString и наоборот?===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;# &lt;/del&gt;Для конвертирования BSTR в CString нужно просто присвоить переменной типа CString переменную типа BSTR. Оператор &amp;quot;=&amp;quot; класса CString сам выполнит всю работу.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* &lt;/ins&gt;Для конвертирования BSTR в CString нужно просто присвоить переменной типа CString переменную типа BSTR. Оператор &amp;quot;=&amp;quot; класса CString сам выполнит всю работу.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;# &lt;/del&gt;Для конвертирования BSTR в CString нужно выполнить код:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* &lt;/ins&gt;Для конвертирования BSTR в CString нужно выполнить код:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>RXL</name></author>	</entry>

	<entry>
		<id>https://wiki.shelek.ru/index.php?title=FAQ:WinAPI_VCPP:%D0%BF%D0%B5%D1%80%D0%B5%D0%B2%D0%BE%D0%B4_%D0%BC%D0%B5%D0%B6%D0%B4%D1%83_BSTR_%D0%B8_CString&amp;diff=709&amp;oldid=prev</id>
		<title>RXL: Новая: ===Как корректно перевести тип BSTR в CString и наоборот?===  # Для конвертирования BSTR в CString нужно просто присв...</title>
		<link rel="alternate" type="text/html" href="https://wiki.shelek.ru/index.php?title=FAQ:WinAPI_VCPP:%D0%BF%D0%B5%D1%80%D0%B5%D0%B2%D0%BE%D0%B4_%D0%BC%D0%B5%D0%B6%D0%B4%D1%83_BSTR_%D0%B8_CString&amp;diff=709&amp;oldid=prev"/>
				<updated>2009-10-03T12:23:55Z</updated>
		
		<summary type="html">&lt;p&gt;Новая: ===Как корректно перевести тип BSTR в CString и наоборот?===  # Для конвертирования BSTR в CString нужно просто присв...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;===Как корректно перевести тип BSTR в CString и наоборот?===&lt;br /&gt;
&lt;br /&gt;
# Для конвертирования BSTR в CString нужно просто присвоить переменной типа CString переменную типа BSTR. Оператор &amp;quot;=&amp;quot; класса CString сам выполнит всю работу.&lt;br /&gt;
# Для конвертирования BSTR в CString нужно выполнить код:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// указатель на будущий буфер с BSTR.&lt;br /&gt;
// По сути, BSTR определён как typedef WCHAR* BSTR;&lt;br /&gt;
// то есть - указатель на 16-битный символ юникод.&lt;br /&gt;
BSTR bstrHE = 0;&lt;br /&gt;
&lt;br /&gt;
// строка для конвертации&lt;br /&gt;
CString Str = &amp;quot;мой текст&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Выделяем память и загружаем адрес блока в bstrHE&lt;br /&gt;
bstrHE = Str.AllocSysString();&lt;br /&gt;
&lt;br /&gt;
// ...	&lt;br /&gt;
// тут работаем с bstrHE[]&lt;br /&gt;
// ...&lt;br /&gt;
&lt;br /&gt;
// освобождаем память&lt;br /&gt;
SysFreeString(bstrHE);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ:WinAPI VCPP]]&lt;/div&gt;</summary>
		<author><name>RXL</name></author>	</entry>

	</feed>