OleQueryProtocol

  void FAR* OleQueryProtocol(lpobj, lpszProtocol)    
  LPOLEOBJECT lpobj; /* pointer to object to query */
  LPCSTR lpszProtocol; /* pointer to string for protocol to query */

The OleQueryProtocol function determines whether an object supports a specified protocol.

Parameters

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.”

Return Value

The return value is a VOID pointer to an OLEOBJECT structure or NULL if the object does not support the requested protocol. The library can return OLE_WAIT_FOR_RELEASE when an application calls this function.

Comments

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 the OleQueryProtocol function, specifying “StdExecute” in the lpszProtocol parameter, before calling the OleExecute function. This allows the client application to determine whether the server for an object supports DDE execute commands.

See Also

OleExecute