Handling BINDINFO Structures

Handling BINDINFO Structures


The BINDINFO structure is used by methods, like IBindStatusCallback::GetBindInfo, to pass information that specifies how a bind operation should be handled. To properly write information to this structure, the client application should:

Clearing the BINDINFO structure, before writing information into it, to prevent members that are not being used from containing incorrect data. The following code fragment demonstrates how to clear the structure.

//pbindinfo is a pointer to a BINDINFO structure
DWORD cbSize = pbindinfo->cbSize;        
memset(pbindinfo,0,cbSize);
pbindinfo->cbSize = cbSize;

Since the size of the BINDINFO structure has increased in the Microsoft Internet Explorer 4.0, client applications should check the size of the structure that is passed into their implementation of any methods that use this structure.

The following sample demonstrates how to check the size of the structure for accessing members of the BINDINFO structure beyond cbstgmedData.

if (pbindinfo->cbSize >= offsetof(BINDINFO, dwReserved))
{
    // Write to additional fields
}
else
{
    // Added functionality is not available, so make any adjustments necessary.
}

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.