{"id":5062,"date":"2014-10-07T19:35:03","date_gmt":"2014-10-07T10:35:03","guid":{"rendered":"http:\/\/umezawa.dyndns.info\/wordpress\/?p=5062"},"modified":"2014-10-07T20:13:21","modified_gmt":"2014-10-07T11:13:21","slug":"stgmedium-%e3%81%ae%e6%82%aa%e5%a4%a2-windows-net","status":"publish","type":"post","link":"http:\/\/umezawa.dyndns.info\/wordpress\/?p=5062","title":{"rendered":"STGMEDIUM \u306e\u60aa\u5922 (Windows\/.NET)"},"content":{"rendered":"<p>\u7d50\u8ad6\u304b\u3089\u8a00\u3046\u3068\u3001<a href=\"http:\/\/msdn.microsoft.com\/ja-jp\/library\/system.runtime.interopservices.comtypes.stgmedium%28v=vs.100%29.aspx\">.NET \u306b\u3042\u308b System.Runtime.InteropServices.ComTypes.STGMEDIUM<\/a> \u306f\u4f7f\u3063\u3066\u306f\u3044\u3051\u307e\u305b\u3093\u3002\u7279\u5b9a\u306e\u72b6\u6cc1\u4e0b\u3067\u30a2\u30f3\u30de\u30cd\u30fc\u30b8\u30e1\u30e2\u30ea\u304b\u3089\u30de\u30cd\u30fc\u30b8\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3078\u306e\u30de\u30fc\u30b7\u30e3\u30ea\u30f3\u30b0\u306b\u5931\u6557\u3057\u3001NotImplementedException \u304c\u30b9\u30ed\u30fc\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><!--more--><\/p>\n<p>Windows Server 2008 x86 \u4e0a\u3067 <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms675899%28v=vs.85%29.aspx\">Directory Object Picker<\/a> \u3092 .NET \u3067\u4f7f\u3063\u305f\u6642\u3001\u8fd4\u3063\u3066\u304d\u305f IDataObject \u306e GetData \u3092\u547c\u3076\u3068 NotImplementedException \u304c\u30b9\u30ed\u30fc\u3055\u308c\u308b\u3001\u3068\u3044\u3046\u73fe\u8c61\u306b\u906d\u9047\u3057\u307e\u3057\u305f\u3002IDataObject \u306f\u30c7\u30fc\u30bf\u3092\u904b\u3076\u306e\u304c\u4ed5\u4e8b\u3067\u3059\u304b\u3089\u3001\u4ed6\u306e\u30e1\u30bd\u30c3\u30c9\u306a\u3089\u3068\u3082\u304b\u304f GetData \u304c E_NOTIMPL \u3067\u5931\u6557\u3059\u308b\u306e\u306f\u3042\u308a\u5f97\u306a\u3044\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u3057\u3070\u3089\u304f\u30b0\u30b0\u3063\u3066\u3044\u305f\u3089\u3001<a href=\"http:\/\/joco.name\/2011\/03\/27\/directory-object-dialog-in-net-and-advanced-com-marshaling\/\">\u540c\u3058\u3088\u3046\u306a\u3053\u3068\u3092\u3084\u3063\u3066\u3044\u308b\u4eba\u306e\u8a18\u4e8b<\/a>\u304c\u898b\u3064\u304b\u308a\u3001\u3053\u3053\u306e &#8220;STGMEDIUM nightmares&#8221; \u306e\u7bc0\u306b\u539f\u56e0\u304c\u66f8\u3044\u3066\u3042\u308a\u307e\u3057\u305f\u3002Directory Object Picker \u3067\u8ffd\u52a0\u3067\u53d6\u5f97\u3059\u308b\u30a2\u30c8\u30ea\u30d3\u30e5\u30fc\u30c8\u3092\u6307\u5b9a\u3057\u305f\u5834\u5408\u3001STGMEDIUM \u306e pUnkForRelease \u30d5\u30a3\u30fc\u30eb\u30c9\u304c object \u578b\u3068\u3057\u3066\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u305b\u3044\u3067\u3001\u30a2\u30f3\u30de\u30cd\u30fc\u30b8\u30e1\u30e2\u30ea\u4e0a\u3067 NULL \u3067\u306a\u3044\u5024\u3092\u6301\u3064 pUnkForRelease \u306e\u30de\u30cd\u30fc\u30b8\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3078\u306e\u30de\u30fc\u30b7\u30e3\u30ea\u30f3\u30b0\u306b\u5931\u6557\u3057\u3001\u305d\u3053\u3067\u4f55\u6545\u304b NotImplementedException \u304c\u30b9\u30ed\u30fc\u3055\u308c\u308b\u3001\u3068\u3057\u3066\u3044\u307e\u3059\uff08MarshalingException \u3068\u304b\u3058\u3083\u306a\u3044\u3093\u3060\u306a\u2026\uff09\u3002\u305f\u3060\u3001\u624b\u5143\u306e Windows 7 x64 \uff08\u4f7f\u308f\u308c\u308b .NET Framework \u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306f\u540c\u3058\uff09\u306e\u5834\u5408\u306f NULL \u3067\u306f\u306a\u3044\u5024\u3067\u3042\u3063\u3066\u3082\u6b63\u3057\u304f\uff08\u3068\u3044\u3046\u304b\u4f8b\u5916\u306b\u306a\u3089\u305a\u306b\uff09\u30de\u30fc\u30b7\u30e3\u30ea\u30f3\u30b0\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u306a\u306e\u3067\u3001\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u30dd\u30a4\u30f3\u30bf\u304c\u6307\u3057\u3066\u3044\u308b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u3088\u3063\u3066\u6210\u529f\u3057\u305f\u308a\u5931\u6557\u3057\u305f\u308a\u3059\u308b\u3082\u306e\u3068\u601d\u308f\u308c\u307e\u3059\u3002<\/p>\n<p>\u3068\u3044\u3046\u308f\u3051\u3067\u3001\u8a66\u3057\u306b STGMEDIUM \u3092\u81ea\u524d\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5b9a\u7fa9\u3057\u306a\u304a\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<blockquote>\n<pre>[StructLayout(LayoutKind.Sequential)]\r\npublic struct STGMEDIUM\r\n{\r\n    public uint tymed;\r\n    public IntPtr unionmember;\r\n    public IntPtr pUnkForRelease; \/\/ \u3053\u3053\u304c\u9055\u3046\r\n}\r\n<\/pre>\n<\/blockquote>\n<p>\u5b9f\u969b\u306b\u306f\u3053\u308c\u3060\u3051\u3067\u306f\u306a\u304f\u3001\u5dfb\u304d\u6dfb\u3048\u3092\u98df\u3063\u3066 IDataObject \u3084\u3089 FORMATETC \u3084\u3089\u3001\u3044\u308d\u3044\u308d\u3068\u81ea\u524d\u3067\u5b9a\u7fa9\u3057\u306a\u304a\u3059\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3067\u3001\u3053\u306e\u81ea\u524d\u306e STGMEDIUM \u7b49\u3092\u4f7f\u3063\u3066\u307f\u308b\u3068\u3001\u4e0a\u8a18\u306e\u74b0\u5883\u3067\u3082\u671f\u5f85\u3057\u305f\u3068\u304a\u308a\u306b\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002pUnkForRelease \u3092 IntPtr \u3067\u306f\u306a\u304f object \u306b\u3059\u308b\u3068\u3001\u305d\u308c\u3060\u3051\u3067 NotImplementedException \u304c\u30b9\u30ed\u30fc\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308b\u306e\u3067\u3001\u30de\u30fc\u30b7\u30e3\u30ea\u30f3\u30b0\u306e\u554f\u984c\u3067\u3042\u308b\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002<\/p>\n<p>pUnkForRelease \u306f STGMEDIUM \u3092\u89e3\u653e\u3059\u308b\u305f\u3081\u306b\u4f7f\u3046\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u30dd\u30a4\u30f3\u30bf\u306a\u306e\u3067\u3059\u304c\u3001\u5b9f\u969b\u306b STGMEDIUM \u3092\u89e3\u653e\u3059\u308b\u3068\u304d\u306f <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/ms693491%28v=vs.85%29.aspx\">ReleaseStgMedium API<\/a> \u3092\u547c\u3076\u306e\u3067\u3001pUnkForRelease \u306e\u30de\u30cd\u30fc\u30b8\u578b\u304c\u4f55\u3067\u3042\u308b\u304b\u306f\u554f\u984c\u306b\u306a\u308a\u307e\u305b\u3093\u3002\u3080\u3057\u308d\u3001\u4f59\u8a08\u306a\u30de\u30fc\u30b7\u30e3\u30ea\u30f3\u30b0\u52d5\u4f5c\u304c\u767a\u751f\u3057\u306a\u3044\u5206\u3001IntPtr \u306b\u306a\u3063\u3066\u3044\u305f\u65b9\u304c\u5b89\u5168\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<hr \/>\n<p>\u6700\u521d\u306b .NET \u306e System.Runtime.InteropServices.ComTypes.STGMEDIUM \u306f\u4f7f\u3063\u3066\u306f\u3044\u3051\u306a\u3044\u3001\u3068\u66f8\u304d\u307e\u3057\u305f\u304c\u3001\u3053\u308c\u306f\u30cd\u30a4\u30c6\u30a3\u30d6\u30b3\u30fc\u30c9\u304c\u63d0\u4f9b\u3059\u308b STGMEDIUM \u3092\u30de\u30cd\u30fc\u30b8\u30b3\u30fc\u30c9\u304b\u3089\u89e6\u308b\u6642\u306e\u8a71\u3067\u3059\u3002\u30de\u30cd\u30fc\u30b8\u30b3\u30fc\u30c9\u5074\u304c STGMEDIUM \u3092\u63d0\u4f9b\u3059\u308b\u5834\u5408\u306b\u3069\u3046\u3044\u3046\u3053\u3068\u306b\u306a\u308b\u306e\u304b\u306f\u5206\u304b\u308a\u307e\u305b\u3093\u3002\u305d\u3082\u305d\u3082\u8208\u5473\u306a\u3044\u3057\u2026<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7d50\u8ad6\u304b\u3089\u8a00\u3046\u3068\u3001.NET \u306b\u3042\u308b System.Runtime.InteropServices.ComTypes.STGMEDIUM \u306f\u4f7f\u3063\u3066\u306f\u3044\u3051\u307e\u305b\u3093\u3002\u7279\u5b9a\u306e\u72b6\u6cc1\u4e0b\u3067\u30a2\u30f3\u30de\u30cd\u30fc\u30b8\u30e1\u30e2\u30ea\u304b\u3089\u30de\u30cd\u30fc\u30b8\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3078\u306e\u30de\u30fc [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[],"class_list":["post-5062","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/5062","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5062"}],"version-history":[{"count":12,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/5062\/revisions"}],"predecessor-version":[{"id":5074,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/5062\/revisions\/5074"}],"wp:attachment":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5062"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5062"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5062"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}