This blog has moved!

Check out www.CodeBetter.com/blogs/grant.killian

<July 2008>
SuMoTuWeThFrSa
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789


Navigation

Professional Props...

Extracurricular Props...

Subscriptions

Article Categories



Wednesday, November 17, 2004 - Posts

Time well forgotten

As I said in my previous post, I've been doing a lot of unmanaged windows development lately.  I started work on a proof-of-concept for a different project where I need to present a list of fonts for the user to select from.  My first thought was windows API here I come.  I scared up the following interop code:

[DllImport( "gdi32", EntryPoint="EnumFontFamiliesEx" ) ] public static extern int EnumFontFamiliesExA( int hDC, ref LOGFONT lpLogFont, int lpEnumFontProc, int lParam, int dw )

Luckily for me I didn't pursue this route for long.  It dawned on me like a fresh pair of socks, all warm and snug from the dryer: Microsoft has exposed a new set of APIs through the .Net framework that allows easier, object oriented access to resources like the available system fonts.  Duh!  A quick perusal of some documentation brought me to this:

cboFont.DataTextField = "name" ;
cboFont.DataSource = new System.Drawing.Text.InstalledFontCollection().Families ;
cboFont.DataBind() ;

Ah, sweet nourishing System.Drawing.Text.InstalledFontCollection().Families.  It's going to take me a little while to forget the last month or so of unmanaged debugging . . . but it will be time well forgotten!

posted Wednesday, November 17, 2004 10:20 AM by grant.killian

Haven't posted in a bit, getting back in the saddle

The title says it all; I've been stretched thinly across so many projects the last month+ that I haven't had much time to blog.  One of those time consuming projects was a VB6 rescue operation that is, I think, finally under control.  Nobody wants to read my posts about the MsCal.ocx control and “legacy” unmanaged stuff.  Combine all that with the dotnetjunkies site periodically being down and you've got a recipe for Grant not blogging.

Enough with the excuses.  More soon!

 

posted Wednesday, November 17, 2004 10:08 AM by grant.killian




Powered by Dot Net Junkies, by Telligent Systems