July 31, 2001 tools

VARIANT_BOOL Wrapper

July 31, 2001

CComBool is a class to prevent the misuse of the VARIANT_BOOL type. VARIANT_BOOL is a problem because its legal values are -1 and 0 instead of 1 and 0, making converting back and forth between bool, BOOL and VARIANT_BOOL problematic. CComBool supports the constructors and operators needed to convert between the three C++ Windows Boolean types. It also supports operator& and CopyTo for common COM client and server usage. CComBool is available here.

July 30, 2001 tools

ATL CRT Numbers

July 30, 2001

The following table lists the various prices you pay for using the CRT and the default Win98 support in VC6. The builds were done with VC6, SP3, ATL COM in-proc server, no classes, no MFC, no merged p/s:

Target CRT Win98 Size
RelMinSize _ATL_MIN_CRT yes 24KB
RelMinDepend _ATL_MIN_CRT yes 24KB
RelMinSize _ATL_MIN_CRT /opt:nowin98* 7KB
RelMinDepend _ATL_MIN_CRT /opt:nowin98 10KB
RelMinSize MSVCRT /opt:nowin98 20KB
RelMinDepend MSVCRT /opt:nowin98 22KB

*Note: /opt:nowin98 is a VC6 linker switch that says not to align binaries on a Win98-friendly boundary. /opt:nowin98 builds will still load and run under Win98 without a problem, but the loading time could be longer. Also, when images get above 24KB, the /opt:nowin98 seems not to much of an affect on the size of the image.

July 29, 2001 tools

VBLite

July 29, 2001

Dharma Shukla and I wrote Extending ATL3.0 Containment to Help You Write Real-World Containers” in the 12/99 issue of MSJ detailing how to add much-needed features to ATLs support for control containment. Dharma wrote the sample code that accompanies the piece and has already made improvements to the code based on feedback. He’s maintaining the history and bits here.

July 28, 2001 tools

Attila

Attila stands for ATL for Applications.” Attila is a set of extensions built on top of ATL to provide application-level services in the same flavor as MFC. Towards that end, Attila uses a lot of the same notions as ATL, e.g. heavy use of templates, static binding and reliance on the compiler and the linker doing their job.  Also, in the flavor of ATL, Attila is under-documented and requires a lot of user investment to make use of it. However, once you do, we think you’ll find the flexibility and efficiency worth it. If you don’t, you haven’t lost much, cuz Attila is free. Enjoy.

July 27, 2001 tools

Simple Object II ATL ObjectWizard Extension

July 27, 2001

The Simple Object II ATL ObjectWizard Extension (whew — I’ve got to come up with a shorter name…) provides the following features:

  • Support for [oleautomation] interfaces.
  • Support for the Neutral-threaded apartment.
  • Support for IDispatch-based interfaces other than duals.
  • Better support for disabling features that do not make sense together, e.g. FTM + ThreadingModel=Apartment.
  • Updated pop-up help.

Originally, SimpleObject2 was built to do away with the one benefit of IDispatchImpl over IDelegatingDispImpl — wizard support. As do most things developed under the greedy eye of my colleagues, it grew to support a few more features than that. It’s available for download here. Enjoy. 

July 26, 2001 tools

CComVector: A SAFEARRAY Wrapper

July 26, 2001

I got tired of not having a smart type for SAFEARRAYs, so I built one. It’s limited to one dimension (does anyone use multi-dimentional SAFEARRAYs?) and provides one class for the SAFEARRAY and another for the data itself (the lock is a resource, too), but the usage is pretty nifty. See comvector.h for the what and the how.

Also, Ron Jacobs sent me an ATL port of COleSafeArray called CComSafeArray that I’ve made available here.

July 25, 2001 tools

CComDate

July 25, 2001

This zip provides two classes for use with dates and times under Windows:

  • CComDATE: Wraps the COM DATE type, providing conversions from VARIANT, DATE, ANSI string, UNICODE string, time_t, SYSTEMTIME, FILETIME, DOS time and DBTIMESTAMP data types.
  • CComSpan: Represents the result of subtracting one CComDATE from another. Useful for time/date math.
July 24, 2001 tools

Exposing Multiple IDispatch Interfaces

If you’d like to know about how to expose multiple IDispatch implementations from a single COM object, check out this extensive treatment of that very topic.


← Newer Entries Older Entries →