Monday, September 3, 2012

Interoperability issues when importing COM dll to .NET

Well, Another gotcha. To summarize the problem I was facing, there is a COM component, with its well defined interfaces, integrated into a (C#) .NET project. There is a new version of the component, with few more APIs, and I had to integrate and test the new component. The source code for the COM component was available, and I can't change it as its used by multiple other projects.

For integration purpose, using the type library file (tlb), I created the interop library file using Type library import and when I imported this into the .NET project by Adding a Reference, and perform compilation, failures were reported by the compiler for one of the existing API's. There was a library file created for the earlier version of the dll, and with that the compilation went through, which was puzzling to me, as there was no change in the existing API's. I used ildasm to examine the API's of both the interop libraries. When I compared both of them, there was a difference in parameter between the two for a specific API, and the parameter passed to the API, in the later version seemed weird, but I was left wondering how can there be difference. [ Btw, The parameter troubling me was a double pointer to a BSTR ]

MSDN to the rescue. That's when I  landed on this page, which stated that though the import process usually produces accurate interop assemblies, occassionally there is a need to modify the interop. I edited the interop assembly which was the right thing to do, for me. This page briefly states the procedure to do so, by first creating the MSIL file, editing it and creating the new dll.

I lost a couple of hours, for not being aware of it, hence this post, which hopefully helps someone save some time.

Sunday, January 23, 2011

iPad Review

Here are few initial impressions of iPad ( non 3G version) - my first apple device.

+ Just the right size as a portable device to view pictures, video content and to read e books ; galaxy tab beats this in portability but that has poor experience for reading/videos/browsing and it has poorer touch experience; some might say iPad is a glorified iPod - true but worth it.
+ Battery life - should be more than 10 hours if you are using continuously.
+ Email and browsing - Email app is neat.
+ Some apps which I liked / use frequently :
  • Twitter : split page view of tweets , inline presentation of web contenet , lets you cascade through various tweets / pages / profiles and keeps the linkage so that you can come right back
  • gmail browser app : neat presentation of mail content ; caching support
  • notes : nice utility for some quick notes
  • Vlc : super app to play non mp4 videos - best free app to support various formats ; while one may have to use iTunes to add content vlc allows deletion of content directly
  • Maps : google maps designed for iPad - pretty good !
  • Flipboard : Best reading app ! Newspaper like presentation of feed content , which can be flipped through - can be linked to twitter , fb accounts
  • linkedin, imdb, eyewitnesses, ndtv , BBC, radiosai, & Many others.
+ recently introduced multitasking and grouping features ; however multitasking can lead to some overhead at times

+ another simple feature that many may fail to notice is the ability to take screenshots and store them as images

- iTunes overhead for adding content and no support for USB / microsd; can't transfer photos from my camera without using a computer ; every other tablet released supports usb/sd I guess; will apple consider it as a competitive factor and start supporting the same ? I
seriously doubt it.

- missing camera ; front camera to support video calls for VoIP would have been great - I believe it will be available in the next version ; supporting a back camera would be awkward though due to it's size unlike samsung tab which can be held in one hand and has dual camera ;

# I wonder if touch devices will ever provide as good typing experience as a keyboard ; iPad is better than other touch devices though.. ;

# default version of galaxy tab can act as a phone and is available in India already ; why does apple take a long time before they make their devices available in India ? Aren't they losing a lot of potential customers ?

# I used to think it is over priced but after looking at pricing of other tablets I felt it's reasonable

# Found the missing features compensated via accessories such as camera connector which surely are over priced ; do people buy such stuff ?

will add more comments ..

Wednesday, November 3, 2010

why interface inheritance is better ?

As much as i was convinced about it, i always got confused about this. Some useful links that would clarify :

http://www.javaworld.com/javaworld/jw-08-2003/jw-0801-toolbox.html