HI

> One serious recommendation: stay away from MFC when writing COM 
servers, and
> use ATL instead.  It's easier to use, easier to read, has less bloat, 
has
> less unintuitive conventions, and IMO rocks!

Yes, but often you want to add Automation to an application that is 
already written in C++ so that you can use it form something like VB.

Of course you should really just stay away from MFC altogether.

> That's a common gotcha.  I usually do something like:
> 
>  class COMInit
>  {
>   COMInit() { CoInitialize( NULL ); }
>   ~COMInit() { CoUninitialize(); }
>  } const g_init;

I do as well, although I have a slightly more sophisticated version 
that allows me to set the threading type and securitty params.

If you came to an interview with me and claimed to know COM I'd ask you 
question that leads to this.

Regards
Paul

Paul Grenyer
Email: [EMAIL PROTECTED]
Web: http://www.paulgrenyer.co.uk

Have you met Aeryn: http://www.paulgrenyer.co.uk/aeryn/?
Version 0.3.0 beta now available for download.




Reply via email to