<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>potisan</author_name>
  <author_url>https://blog.hatena.ne.jp/potisan/</author_url>
  <blog_title>potisanのプログラミングメモ</blog_title>
  <blog_url>https://potisan-programming-memo.hatenablog.jp/</blog_url>
  <categories>
    <anon>C++</anon>
    <anon>Windows</anon>
    <anon>WIL</anon>
  </categories>
  <description>Windows環境でLPWSTRからスマートポインタ的なBSTRを作成する方法には次の2通りあります。 _bstr_t(...) &lt;comutil.h&gt; wil::make_bstr(...) &quot;wil/com.h&quot; 前者の_bstr_t(...)はコンパイラ付属なので追加インストールが不要ですが、ムーブセマンティクス非対応で独自の参照カウンタを使用しています。作成する度に参照カウント管理用にクラスがnewされます。また、LPWSTR/LPSTR等からの作成に対応しています。 後者のwil::make_bstr(...)はMicrosoftのパッケージですが追加インストールが必要です。ムーブセ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpotisan-programming-memo.hatenablog.jp%2Fentry%2F2023%2F12%2F18%2F212455&quot; title=&quot;C++&amp;amp;Win API _bstr_tとwil::make_bstr - potisanのプログラミングメモ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2023-12-18 21:24:55</published>
  <title>C++&amp;Win API _bstr_tとwil::make_bstr</title>
  <type>rich</type>
  <url>https://potisan-programming-memo.hatenablog.jp/entry/2023/12/18/212455</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
