Skip to Content
Learning DCOM
book

Learning DCOM

by Thuan L. Thai
April 1999
Intermediate to advanced
502 pages
15h 5m
English
O'Reilly Media, Inc.
Content preview from Learning DCOM

Nonblocking Calls

Asynchronous communication is supported in Windows 2000 by a feature that is called nonblocking calls, which allows a client to request a lengthy operation without being blocked. In other words, the client can proceed with further processing after requesting the operation. The server component will notify the client when the lengthy operation is completed. Windows 2000 supports asynchronous invocation via a new MIDL interface attribute called async_uuid. An example of an asynchronous interface is shown here:

[ object, uuid(D9F23D61-A647-11d1-ABCD-00207810D5FE),
  async_uuid(AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA) ]
interface IOcr : IUnknown {
    HRESULT OcrImage([in] long lImageSize,
                     [in, size_is(lImageSize)] byte * pbImage,
                     [out, string] wchar_t **pwszOcrText);
}

Because this MIDL snippet uses the async_uuid attribute, MIDL will generate two interface definitions for the IOcr interface: a normal (synchronous) version and an asynchronous version. You are familiar with the synchronous version:

interface IOcr : public IUnknown {
public:
   virtual HRESULT OcrImage(
      /* [in] */ long lImageSize,
      /* [size_is][in] */ byte *pbImage,
      /* [string][out] */ wchar_t **pwszOcrText) = 0;
};

But you’ve never seen the asynchronous version:

interface AsyncIOcr : public IUnknown {
public:
   virtual HRESULT begin_OcrImage(
      /* [in] */ long lImageSize,
      /* [size_is][in] */ byte *pbImage) = 0;
   virtual HRESULT finish_OcrImage(
      /* [string][out] */ wchar_t **pwszOcrText) = 0;
};

The asynchronous version ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

.NET and COM: The Complete Interoperability Guide

.NET and COM: The Complete Interoperability Guide

Adam Nathan
Windows 7 Device Driver

Windows 7 Device Driver

Ph.D. Ronald D. Reeves

Publisher Resources

ISBN: 9781449307011Supplemental ContentErrata Page