{"id":395,"date":"2008-06-05T14:51:43","date_gmt":"2008-06-05T12:51:43","guid":{"rendered":"https:\/\/alax.info\/blog\/?p=395"},"modified":"2008-06-05T16:25:49","modified_gmt":"2008-06-05T14:25:49","slug":"crap-around-the-world-importing-imapi2dll-type-library-part-2","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/395","title":{"rendered":"Crap around the world: Importing IMAPI2.DLL type library (Part 2)"},"content":{"rendered":"<p>IMAPI version 2 is well designed &#8211; no arguments &#8211; file systems, recorders, data streams, notifications, dispatch interfaces to be compatible with scripting, higher level development environments and interoperation layer. Still I am armed with C++ at the very moment and back to type library imports using #import.<\/p>\n<p>I want to know why the hell it is required to sort out mess even between the two API modules: IMAPI2.DLL and IMAPI2FS.dll:<\/p>\n<blockquote><p>#pragma warning(disable: 4192)<br \/>\n#import &#8220;libid:2735412F-7F64-5B0F-8F00-5D77AFBE261E&#8221; no_namespace raw_interfaces_only raw_dispinterfaces \/\/ IMAPI2<br \/>\n#import &#8220;libid:2C941FD0-975B-59BE-A960-9A2A262853A5&#8221; no_namespace raw_interfaces_only raw_dispinterfaces exclude(&#8220;_IMAPI_MEDIA_PHYSICAL_TYPE&#8221;, &#8220;IDiscRecorder2&#8221;) \/\/ IMAPI2FS<br \/>\n#pragma warning(default: 4192)<\/p><\/blockquote>\n<p>In order to import into C++ project, it is required to exclude two items which are duplicate between the modules. OMFG.<\/p>\n<p>Still it is not the end. Since I am subscribing to events using ATL&#8217;s <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/d7eecxta(VS.80).aspx\">IDispEventImpl<\/a> and <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/aaxh168w(VS.80).aspx\">SINK_ENTRY_EX<\/a>, I need <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms221242(VS.85).aspx\">DISPID<\/a> values for the Update methods of <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/aa364823(VS.85).aspx\">DDiscFormat2DataEvents<\/a> and <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/aa364834(VS.85).aspx\">DFileSystemImageEvents<\/a>. How do I find them? Type library as usual? No, my dear friend, type library does not mention this useless value&#8230; For further reference:<\/p>\n<ul>\n<li>DFileSystemImageEvents::Update &#8211; DISPID is <strong>256<\/strong><\/li>\n<li>DDiscFormat2DataEvents::Update &#8211; DISPID is <strong>512<\/strong><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>IMAPI version 2 is well designed &#8211; no arguments &#8211; file systems, recorders, data streams, notifications, dispatch interfaces to be compatible with scripting, higher level development environments and interoperation layer. Still I am armed with C++ at the very moment and back to type library imports using #import. I want to know why the hell&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/395\">Read the full article<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[71],"class_list":["post-395","post","type-post","status-publish","format-standard","hentry","category-seriously","tag-imapi"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/395","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/comments?post=395"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/395\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=395"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=395"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}