Software Geek

March 26, 2008

Versioning/Deploying Unmanaged Files

Filed under: Software

Also see: Important changes to the BASE element for IE 7

Also see: Blogging and Newspapers, a Lesson in How Not to Brand and Market

Also see: Chris Sells

An unmanaged dll can be wrapped in a managed assembly by adding it as a file of a multi-module assembly. Then, it can be deployed and versioned in the same way as managed assemblies. (So, that assembly could contain nothing but metadata and unmanaged code - no managed code, if you prefer. It can also contain multiple unmanaged files in the same assembly.)

If your compiler does not support this directly, you can get this to work by adding that file as a linked managed resource. For example, see Visual Studio’s /linkresource option (if using it for command line compiling).

This is useful in the case where DllImport() is used to access a function in that file. That call should be updated with the new assembly’s info. For example, in the place of “unmanagedfile.dll”, change it to include the display name like this: “unmanagedfile.dll, managedassembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″.

If that unmanaged file needs to be loaded by LoadLibrary() outside of DllImport(), however, it will need to follow the rules of LoadLibrary(), like the usual unmanaged file use outside the CLR. (See Junfeng’s blog for an extra tip regarding that when using v2.)


http://blogs.msdn.com/suzcook/archive/2004/10/28/versioning-deploying-unmanaged-files.aspx

Quick attempt at a validating roman numeral parser… Lots of gotchas.

Filed under: Software

Also see: Why Yahoo should say Yes to MicroSoft

Also see: Help John Baez and Mike Stay!

Got asked about a roman numeral parser during an interview. I have to say that I don’t mind when the process of obtaining employment plays into my strengths. The process was quite similar to a previous process where I wrote a spoken numerics converter. Not only that, there were many similar qualities to my int parsing routines. With that in mind I think I did fairly well. The goal at the time was to produce a routine to validate numbers up to roman numeral 30 or XXX. Didn’t take long, but in the end, I had left out many different validation techniques. I really wanted to revisit the problem since I had the code correctly written in my mind. Check the algorithms out, they should handle just about anything you can throw at them at this point. If you find issues, please feel free to submit your problems, since I’d love to solidfy things a bit more. Apparently roman numeral parsing has great application in reading dates.

Roman Numeral Parsing: Code Only: Bidirectional roman numeral parsing. [EDIT: Added alternate parsing routines and performance fixes]
Integer to Spoken Numerics: Code-Only: int/long/double conversion to Spoken Numerics
Phone Number to Words: Trying my hand at the old Phone number to Words teaser project!
Integer Parsing: DWC.Algorithms.NumberUtilities


http://weblogs.asp.net/justin_rogers/archive/2004/10/24/247032.aspx

Get free blog up and running in minutes with Blogsome
Theme designed by Jay of onefinejay.com