Tuesday, March 29, 2005

COM and .NET Interop - Part II

Out of curiosity, I have been working through some of my COM and .NET Interop issues, and most specifically, working with passing arrays between to / from a C# component from Visual Basic 6.0.  As my earlier post indicates, this is in response to a client’s desire to replace VB6 COM+ components with a .NET implementation in c# while minimizing changes to Classic ASP.  Here are some of my findings.  In cases for strongly-typed arrays, I used strings; loosely-coupled means object in .NET and variant in VB6.

 

  • System.Array is not easily (not sure if it is possible) used with interop
  • Single dimension, strongly-typed arrays are easily used with interop.  In my case, I used strings. However, when used as input parameters, they must be passed byref and zero indexed.
  • Two dimension, strongly-typed arrays are easily used with interop.  They also have the same constraints as single dimension arrays (must be passed byref and must be zero indexed).
  • Zero-indexed arrays could cause a ripple effect in COM client code and requires more investigation.

Sunday, March 20, 2005

Virtual Server 2005 - Part II

I installed the “Virtual Machine Additions” and this significantly improved performance. My virtual machine is Windows XP running on a Compaq ML370, and the performance is definitely reasonable. I just installed Visual Studio 2005 Beta (December) and then Office 2003. I think there were 2 warnings during the install, but everything seems to be fine so far.

By the way, why does Visual Studio 2005 beta require Office 2003 to be installed to create a project? At least, this was one of the warnings I received after installing Visual Studio 2005.

Virtual Server 2005

I have been looking for away to get my feet wet with Visual Studion .NET 2005 but was hesitant to install on any of my properly configured development machines. After some hacking around with Virtual PC 2004, I happened to stumble across Virtual Server 2005. This has some potential. The only big downside is performance.

I found a tidbit about Virtual PC 2004 performance improvements by using a fixed virtual hard drive size; however, I have noticed less performance improvement using the same trick on Virtual Server 2005.

COM and .NET Interop

I have been doing some proof-of-concept work for a client that has a series of n-tier Classic ASP web applications. You will all remember the n-tier architecture of the late 1990’s with Classic ASP pages that call MTS / COM+ components to perform business logic and handle distributed transactions.

My client has implemented all COM+ components as Visual Basic 6.0 components. With the VB end-of-life in 2008 in mind (but not VBScript), my client has requested my to investigate options for migrating VB6 components to .NET and c#.

Some aspects of their architecture lend itself to interop rather easily; however, there is one particular aspect where I have yet to come up with a good alternative. The issue I am referring to is when COM components use two-dimensional arrays to transport data from COM+ components to Classic ASP. When n-tier architecture was the key to a good resume, a common design issue for architects was whether to expose ADORecordset as a parameter in the method signature. One alternative to exposing ADOR on the interface was to use a two-dimensional variant array. This provided a loose-contract avoiding re-compilation when data structure of the parameter changed. For example, if a stored procedure returns a variant array of name/value pairs used to populate a drop-down box in the user-interface.

I have yet to find a clear example of how to replace VB components that expose multi-dimensional variant arrays on their interface. So, if I come up with a good solution, I will be sure to post here, so it is documented for your reference.

If you have seen such an example, be sure to let me know; otherwise, stay tuned.

Sunday, March 13, 2005

Home Improvement

We'll we decided it was time to make the Buckeye room a reality. A trip to Home Depot to get some paint (sweatshirt grey and Stadium Red should do the trick).

1 1/2 hours to remove all furniture, remove outlet covers, blinds, and remve outlet covers.

going to grab some pizza then start cutting in the room. By weeks end, we should have a totally different room.

Thursday, March 10, 2005

First post

Finally moving into the blog world with a place to write about my research.