<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Jigar Mehta's Blog : Interop</title><link>http://blogs.msdn.com/jigarme/archive/tags/Interop/default.aspx</link><description>Tags: Interop</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>COM Interop Sample : Using C# DLL from C++ application</title><link>http://blogs.msdn.com/jigarme/archive/2008/04/28/com-interop-sample-using-c-dll-from-c-application.aspx</link><pubDate>Mon, 28 Apr 2008 20:25:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8435753</guid><dc:creator>Jigar Mehta</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/jigarme/comments/8435753.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jigarme/commentrss.aspx?PostID=8435753</wfw:commentRss><description>&lt;p&gt;I have found many people who are beginning to learn COM Interop, looking for a sample application that explains how to use C# DLL from C++ application.&lt;/p&gt;  &lt;p&gt;Here is one sample that I developed (SLN file is in VS2008 format!)&lt;/p&gt;  &lt;p&gt;&lt;iframe style="border-right: #dde5e9 1px solid; padding-right: 0px; border-top: #dde5e9 1px solid; padding-left: 0px; padding-bottom: 0px; margin: 3px; border-left: #dde5e9 1px solid; width: 240px; padding-top: 0px; border-bottom: #dde5e9 1px solid; height: 66px; background-color: #ffffff" marginwidth="0" marginheight="0" src="http://cid-dd7841dfb6968535.skydrive.live.com/embedrowdetail.aspx/Public/SampleInterop.zip" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/p&gt;  &lt;p&gt;Stay tuned.. &lt;img alt="Wave" src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/103.gif" /&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8435753" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jigarme/archive/tags/Interop/default.aspx">Interop</category></item><item><title>How to register .NET Assembly for COM Interop ?</title><link>http://blogs.msdn.com/jigarme/archive/2008/04/28/how-to-register-net-assembly-for-com-interop.aspx</link><pubDate>Mon, 28 Apr 2008 16:55:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8435417</guid><dc:creator>Jigar Mehta</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jigarme/comments/8435417.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jigarme/commentrss.aspx?PostID=8435417</wfw:commentRss><description>&lt;p&gt;Do you want to use your .NET DLL (assembly) from VB6 or C++ application (native code) ? Yes, you can do that using COM Interop. As per COM rules, you need to get your assembly registered on system (in Registry, yes, thats how COM works!).&lt;/p&gt;  &lt;p&gt;To get an assembly registered on system, you can use regasm utility that comes with .net framework.&lt;/p&gt;  &lt;p&gt;If you have .NET Framework 2.0 installed, regasm would be in following path (assuming you have 32-bit OS)   &lt;br /&gt;C:\windows\microsoft.net\Framework\v2.0.50727\regasm.exe&lt;/p&gt;  &lt;p&gt;If you have 64-bit OS as well as .NET framework installed, you should find 32bit version of regasm in,   &lt;br /&gt;C:\windows\microsoft.net\&lt;strong&gt;Framework&lt;/strong&gt;\v2.0.50727\regasm.exe&lt;/p&gt;  &lt;p&gt;and 64 bit version of regasm should be in,   &lt;br /&gt;C:\windows\microsoft.net\&lt;strong&gt;Framework64&lt;/strong&gt;\v2.0.50727\regasm.exe&lt;/p&gt;  &lt;p&gt;More on regasm and its command line options is described &lt;a href="http://msdn2.microsoft.com/en-us/library/tzat5yw6(VS.71).aspx" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;If you are developing project in Visual Studio, there is option to register your assembly with COM Interop in Project Properties (Right click on project and choose properties), Go to Build tab, There is an option for &amp;quot;Register for COM Interop&amp;quot;. (Basically what it does is, it calls regasm after DLL is built!)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jigarme/WindowsLiveWriter/Howtoregister.NETAssemblyforCOMInterop_1110C/image_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="501" alt="image" src="http://blogs.msdn.com/blogfiles/jigarme/WindowsLiveWriter/Howtoregister.NETAssemblyforCOMInterop_1110C/image_thumb.png" width="717" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;There are two options while registering the assembly for COM Interop,&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Put your assembly in GAC.&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;If you put your assembly in GAC, you don't have to use /codebase command line switch with regasm, because application will be able to find the assembly using default probing mechanisms.&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Assembly is not in GAC.&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Its advisable to use /codebase command line switch when you dont have your assembly in GAC because that will add absolute path for your assembly in registry so that COM client (your native application which uses .NET assembly) can find it.&lt;/li&gt;      &lt;li&gt;Following is what will be written in case if you choose to use /codebase option while registering. (notice the CodeBase key).&lt;/li&gt;   &lt;/ul&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jigarme/WindowsLiveWriter/Howtoregister.NETAssemblyforCOMInterop_1110C/image_4.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="165" alt="image" src="http://blogs.msdn.com/blogfiles/jigarme/WindowsLiveWriter/Howtoregister.NETAssemblyforCOMInterop_1110C/image_thumb_1.png" width="1217" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Stay tuned.. &lt;img alt="Wave" src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/103.gif" /&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8435417" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jigarme/archive/tags/Interop/default.aspx">Interop</category><category domain="http://blogs.msdn.com/jigarme/archive/tags/COM/default.aspx">COM</category><category domain="http://blogs.msdn.com/jigarme/archive/tags/.NET/default.aspx">.NET</category></item><item><title>COM-.NET Interop development? Take care of this thing.</title><link>http://blogs.msdn.com/jigarme/archive/2006/10/13/com-net-interop-development-take-care-of-this-thing.aspx</link><pubDate>Fri, 13 Oct 2006 17:42:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:822173</guid><dc:creator>Jigar Mehta</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/jigarme/comments/822173.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jigarme/commentrss.aspx?PostID=822173</wfw:commentRss><description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;I was trying my hands at creating a .NET 2.0 component that can be consumed by a COM application. &lt;br&gt;One of the errors I got in the process of registering the .NET assembly was &lt;br&gt;RegAsm : warning RA0000 : No types were registered.  &lt;p&gt;This was baffling!! I had done everything right and spent quite some time figuring out what could have gone wrong... until I had a look at the AssemblyInfo.cs. The ComVisible property for the assembly was set to false!! Or the other option would be make all classes and interfaces in your assembly as ComVisible by using ComVisibleAttribute. To access types in a .NET assembly from COM, this property should be set to true. Once I did it, I was able to successfully register the .NET assembly and consume it in my COM component. Be sure to remember this when developing COM - .NET interop applications!! &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=822173" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jigarme/archive/tags/Interop/default.aspx">Interop</category><category domain="http://blogs.msdn.com/jigarme/archive/tags/.NET/default.aspx">.NET</category></item></channel></rss>