<?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>Python 3</anon>
    <anon>Windows</anon>
  </categories>
  <description>HRESULTをc_int32で扱っていたらC++とPythonの整数の扱いでハマりました。 問題：COM関数の戻り値(c_int32)とDXGI_ERROR_NOT_FOUND = 0x887A0002が一致しない。 原因：PythonとC++の数値表現の違い。 Pythonのint型は最大値がないので書いたまま正の値となるが、C++のint型は32ビットなので0x887A0002と書けば負の数と判断される。C++のint型を模倣するc_int32も後者同様。 C++ではDXGI_ERROR_NOT_FOUND = (LONG)0x887A0002 = -2005270526なので、Pyth…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpotisan-programming-memo.hatenablog.jp%2Fentry%2F2025%2F04%2F17%2F011016&quot; title=&quot;Python HRESULTはC++では32ビット符号付き整数（Pythonでは上限なし整数） - 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>2025-04-17 01:10:16</published>
  <title>Python HRESULTはC++では32ビット符号付き整数（Pythonでは上限なし整数）</title>
  <type>rich</type>
  <url>https://potisan-programming-memo.hatenablog.jp/entry/2025/04/17/011016</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
