<?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>
  </categories>
  <description>&lt;propvarutil.h&gt;のVariantToString関数は新しく割り当てたメモリを返しますが、そのメモリを解放すべきかどうかの記載が一切ありません。CoGetMallocで取得したIMallocのGetSizeは正しい値を返すので、おそらくCoTaskMemFree関数で解放すればよいのではないかと想像します。 なお、PropVariantToStringAlloc関数はCoTaskMemFree関数が必要であると明記されています。 #pragma comment(lib, &quot;propsys.lib&quot;) #define STRICT #include &lt;Windows.h&gt; #inc…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpotisan-programming-memo.hatenablog.jp%2Fentry%2F2020%2F11%2F07%2F170151&quot; title=&quot;C++ VariantToStringの戻り値はCoTaskMem関係 - 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>2020-11-07 17:01:51</published>
  <title>C++ VariantToStringの戻り値はCoTaskMem関係</title>
  <type>rich</type>
  <url>https://potisan-programming-memo.hatenablog.jp/entry/2020/11/07/170151</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
