OleRegisterServerDoc

  OLESTATUS OleRegisterServerDoc(lhsrvr, lpszDocName, lpdoc, lplhdoc)    
  LHSERVER lhsrvr; /* server handle */
  LPCSTR lpszDocName; /* pointer to string for document name */
  LPOLESERVERDOC lpdoc; /* pointer to OLESERVERDOC structure */
  LHSERVERDOC FAR* lplhdoc; /* handle of registered document */

The OleRegisterServerDoc function registers a document with the server library in case other client applications have links to it. A server application uses this function when it creates or opens a document other than on a request from the library.

Parameters

lhsrvr

Identifies the server. Server applications obtain this handle by calling the OleRegisterServer function.

lpszDocName

Points to a null-terminated string specifying the permanent name for the document. This parameter should be a fully-qualified path name.

lpdoc

Points to an OLESERVERDOC structure allocated and initialized by the server application.

lplhdoc

Points to a handle that will identify the document. This parameter points to the handle when the function returns.

Return Value

The return value is OLE_OK if the function is successful. Otherwise, it is an error value, which can be OLE_ERROR_HANDLE or OLE_ERROR_MEMORY.

Comments

If the document was created or opened in response to a request from the server library, the server should not register the document by using the OleRegisterServerDoc function. Instead, the server should return a pointer to the OLESERVERDOC structure through the parameter to the relevant function.

See Also

OleRegisterServer, OleRevokeServerDoc