tag:blogger.com,1999:blog-75648223841599840782008-11-14T05:14:37.167ZDestination IUnknownMostly on .NET, Java, Blogosphere, software development and techie stuff by Victor Hadiantovhadiantnoreply@blogger.comBlogger4125tag:blogger.com,1999:blog-7564822384159984078.post-91991170210754711622008-06-27T13:09:00.005+01:002008-06-27T13:18:08.468+01:00Manually creating Interop dll using tlbimp.exeVisual Studio .Net automatically creates Interop dll when you reference the COM dll in your project. This is all nice and behaves as expected, but at times you may want to create the Interop dll manually.<br /><br />Tlbimp.exe is the tool to use. However, strange as it may seems, by default it doesn't do what Visual Studio does. How interesting ...<br /><br />Visual Studio .Net by default add "Interop." at the beginning of the generated Interop dll and set the namespace as the name of the dll <em>sans</em> the ".dll".<br /><br />For example, if the dll is called MyCOM.dll. Visual Studio generates: Interop.MyCOM.dll and creates the Interop dll under MyCOM namespace.<br /><br />To achieve the same effect using tlbimp, you need to use both the /out and /namespace flag. For example:<br /><br />tlbimp /out:Interop.MyCOM.dll /namespace:MyCOM MyCOM.dll<br /><br />Sorted.vhadiantnoreply@blogger.com0tag:blogger.com,1999:blog-7564822384159984078.post-48782429884935001352008-06-25T16:01:00.002+01:002008-06-25T16:09:34.206+01:00Resharper Love & Hate<a href="http://www.jetbrains.com/resharper/">ReSharper</a> is the tool that I can't live without it and I can't live with it. It's easy to say why. First of all I just can't work without the following R# shortcuts:<br /><br />- Ctrl + N (this probably worth 95% of R# price)<br />- Ctrl + B<br />- Ctrl + Shift + B<br />- Alt + F7<br />- Ctrl + Shift + F7<br />- Ctrl + F12<br /><br />And the code analysis is too darn useful:<br /><br />- Auto import<br />- Auto initialise variable through constructor<br />- Generate getter<br />- Plus all the refactoring tools (extract method etc. etc. etc.)<br /><br />But it's really s ..... l .... o .... w. It's worse during debugging session. Every F10 can take up to a second. Evaluating a variable can produce a time-out and it also crashes my debugging session when it's running within NUnit. God knows why.<br /><br />It's such a shame for such a great tool to be super slow. I often had to turn R# off for debugging and turn it back on during coding. The problem with this is that it often screw up the R# keyboard short cuts and I had to reset it again. This takes about 25 minutes in my PC.<br /><br />A lot of people complained about R# regarding its memory foot print and more frequently ... performance. This seems to be a common whinge about it. If only R# is a tad faster, we all will be in coding nirvana. I kid you not.<br /><br />In the mean time I'm investigating CodeRush + Refactor combo as R# replacement.vhadiantnoreply@blogger.com0tag:blogger.com,1999:blog-7564822384159984078.post-63489032095916174512008-03-05T15:24:00.001Z2008-03-06T10:49:47.272ZLoaderLock was detectedBlimey … what was that? This kind of exception, that only happens during debugging, confuses developers. Googling about the problem shows that Microsoft at times gives <a href="http://groups.google.co.uk/group/microsoft.public.dotnet.framework/browse_thread/thread/f842bea28f03f2de/b402b0bc20fede1a">pointless</a> answer. Some blame iTunes about this problem ;)<br /><br />Rather than following the advice to turn this rather useful check in VS 2005, the most <a href="http://groups.google.co.uk/group/microsoft.public.dotnet.framework.clr/browse_thread/thread/4efb2443848c4e65/a7c0cb9fac34f768">probable causes</a> of this problem are:<br /><br />1) An unmanaged dll calls a managed dll on its DLLMain or<br />2) Not marshalling your call back to the main UI thread.<br /><br />Vivek wrote a bit more about this problem <a href="http://vivekthangaswamy.blogspot.com/2006/11/loaderlock-was-detected-error-when.html">here</a>.vhadiantnoreply@blogger.com1tag:blogger.com,1999:blog-7564822384159984078.post-67708074386706217552008-02-20T22:03:00.000Z2008-02-20T22:45:01.049ZNew HomeWell here it is. After years of mucking around with <a href="http://www.movabletype.org/">Movable Type</a>, I've made up my mind that it ain't worth it anymore. Started as curiosity about running my own blogging engine, it's becoming more and more obvious that I just don't have the energy nor time to maintain it.<br /><br />I had this grand idea of having a cool CMS, blogging and online photo library system all on my website. However, just like the guys at Top Gear always say: it was ambitious but rubbish! The Movable Type is now several version old, I never get around to install the CMS and the Coppermine is neglected. Running all these things give me more hassle than I can tolerate. So off with all of them!<br /><br /><a href="http://www.e-gineer.com/">Nathan</a> has the right idea of having Blogger as your main blog engine and publish them via FTP to your webserver. This way you still have all the HTML files on your site while relieving all the boring engine maintenance to Blogger. Owned by Google, I'm sure they won't disappear anytime soon.<br /><br />I'm taking his advice and ditching Movable Type. In fact I'm going to ditch <a href="http://coppermine-gallery.net/">Coppermine</a> install too. That is my failed online photo library attempt and will move my online photos to a <a href="http://vhadiant.sharpcast.com/">managed solution</a>.<br /><br />Don't get me wrong, Movable Type and Coppermine are an excellent software. I just don't have the interest of playing with them anymore.<br /><br />So here it is the new location for Destination IUnknown.vhadiantnoreply@blogger.com0