#include <ole.h> |
void FAR* OleQueryProtocol(lpobj, lpszProtocol) | |||||
LPOLEOBJECT lpobj; | /* address of object to query | */ | |||
LPCSTR lpszProtocol; | /* address of string for protocol to query | */ |
The OleQueryProtocol function checks whether an object supports a specified protocol.
lpobj
Points to the object to query.
lpszProtocol
Points to a null-terminated string specifying the name of the requested protocol. This value can be StdFileEditing or StdExecute.
The return value is a void pointer to an OLEOBJECT structure if the function is successful, or it is NULL if the object does not support the requested protocol. The library can return OLE_WAIT_FOR_RELEASE when an application calls this function.
The OleQueryProtocol function queries whether the specified protocol is supported and returns a modified object pointer that allows access to the function table for the protocol. This modified object pointer points to a structure that has the same form as the OLEOBJECT structure; the new structure also points to a table of functions and may contain additional state information. The new pointer does not point to a different object—if the object is deleted, secondary pointers become invalid. If a protocol includes delete functions, calling a delete function invalidates all pointers to that object.
A client application typically calls OleQueryProtocol, specifying StdExecute for the lpszProtocol parameter, before calling the OleExecute function. This allows the client application to check whether the server for an object supports dynamic data exchange (DDE) execute commands.