Managed Space : Jason Whittington's Radio Weblog

developmentor


 

Subscribe to "Managed Space" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.

 
 

COM Stuff

This is a listing of some tools and toys I developed when I was living in the world of COM:

The COM Spy [more]

This is probably the coolest thing I ever did for the world of COM - it certainly was the most work.  Basically the result of a caffeine-fueled month-long binge, COMSpy is a unique tool that gives you a glimpse into the secret life of your COM objects (see a screen shot).  I have since opened up the source code to it, but alas, nobody has sent me any updates to make it do cooler things, probably because code that results from caffeine binges is rarely the most elegant :)

Simple Async Message Pump [more]
This doohickey makes it a snap to do PostThreadMessage style async processing in ATL, like this:

class CMyClass : public CMessageMap
{
BEGIN_MSG_MAP(CMyClass)
THREAD_MSG_MAP(THREAD_1)
   MESSAGE_HANDLER(WM_xxx, OnThread1Msg)
THREAD_MSG_MAP(THREAD_2)
   MESSAGE_HANDLER(WM_xxx, OnThread2Msg)
THREAD_MSG_MAP(THREAD_3)
   MESSAGE_HANDLER(WM_xxx, OnThread3Msg)
END_MSG_MAP()

CAsyncMessagePump m_Thread1;
CAsyncMessagePump m_Thread2;
CAsyncMessagePump m_Thread3;

HRESULT FinalConstruct()
{
m_Thread1.Start(this, THREAD_1);
m_Thread2.Start(this, THREAD_2);
m_Thread3.Start(this, THREAD_3);
}
...
};

Delegating Connection Point [more] 
Makes it easy to expose connection point interfaces from the inner in an aggregate.   To wit:

class ATL_NO_VTABLE CAggregator : public CComObjectRootEx<&CComSingleThreadModel>, 
public CComCoClass<&CAggregator, &CLSID_Aggregator>,
public IConnectionPointContainerImpl<&CAggregator>,
public IConnectionPointImpl<&IID_IEvents>,
public IAggConnectionPointImpl<&IID_IInnerEvents>
{
IUnknown * m_pInner;
CAggregator() : IAggConnectionPointImpl<&IID_IInnerEvents>(&m_pInner);
{...}
BEGIN_CONNECTION_POINT_MAP(CAggregator) 
CONNECTION_POINT_ENTRY(IID_IEvents)
CONNECTION_POINT_ENTRY(IID_IInnerEvents)
END_CONNECTION_POINT_MAP()
};

 

The HRESULT Hook [more]
Ever wish you could catch S_FALSE in a VB app? 

The script Moniker [more]
This is a moniker that has VBScript as its display name.  Binding the moniker simply calls the script.  Typical usage:

JScriptmk:bind(); function bind(){return new ActiveXObject("MSCal.Calendar");} 

Doing away with IDispEventImpl [more]
This is a drop-in replacement for firing events in ATL.

More?
Pretty much everything else interesting in the COM universe can be reached from Chris Sells' tools page.



© Copyright 2003 Jason Whittington.
Last update: 3/26/2003; 9:23:34 AM.

Click here to visit the Radio UserLand website.