A Warning From Thomas Jefferson

by Codewiz51 March 19, 2009 11:38
Perhaps we should heed Thomas Jefferson: “A government big enough to give you everything you want, is strong enough to take everything you have.”

Working With Excel 2007 in a WTL project

by Codewiz51 March 14, 2009 11:15

I've been working on a WTL utility recently that utilizes Excel 2007. I spent quite a bit of time determining how to use #import to bring Excel 2007 into my WTL/C++ project.

Here are the #import statements I worked out, with help from google:

#import "C:\\Program Files\\Common Files\\Microsoft Shared\\OFFICE12\\MSO.DLL" \
    rename( "RGB", "MSORGB" ) \
    rename( "DocumentProperties", "MSODocumentProperties" ) \
    no_function_mapping

#import "C:\\Program Files\\Common Files\\Microsoft Shared\\VBA\\VBA6\\VBE6EXT.OLB"

#import "C:\\Program Files\\Microsoft Office\\OFFICE12\\EXCEL.EXE" \
    rename( "DialogBox", "ExcelDialogBox" ) \
    rename( "RGB", "ExcelRGB" ) \
    rename( "CopyFile", "ExcelCopyFile" ) \
    rename( "ReplaceText", "ExcelReplaceText" ) \
    exclude("IFont","IPicture") \
    no_function_mapping

The above #import statements were worked out to cause as little trouble as possible when working with the DSOFramer ActiveX control example.

One of my favorite tricks is to create a fake project to generate header files from the #import statements. Once the headers are created, they can be utilized in place of the #import statements in your project. I like generating headers so I can modify the interface calls to utilize ATL classes like CComBSTR and CComVariant, rather than relying on the compiler supported classes _bstr_t and _variant_t. The latter classes are very "heavy weight" with a lot of functionality not usually required for most WTL projects.

Buffalo and the NJCAA Swimming and Diving finals

by Codewiz51 March 10, 2009 07:48

My son had an excellent swim meet at the NJCAA finals. We thoroughly enjoyed our trip to Buffalo.

However, I'm glad I live in Oklahoma. The big, old industrial cities in the Northeast just seem so dreary: row houses, lack of parking, cold and armed security guards everywhere.

Here are the event event results:  2009 NJCAA Swimming & Diving Champs

Tags:

Life

Powered by BlogEngine.NET 1.6.0.0
Theme by Mads Kristensen | Modified by Mooglegiant


Disclaimer

This blog represents my personal hobby, observations and views. It does not represent the views of my employer, clients, especially my wife, children, in-laws, clergy, the dog, the cats or my daughter's horse. In fact, I am not even sure it represents my views when I take the time to reread postings.

All comments are moderated for content.

© Copyright 2008-2010