#include <ole.h> |
OLESTATUS OleRegisterServerDoc(lhsrvr, lpszDocName, lpdoc, lplhdoc) | |||||
LHSERVER lhsrvr; | /* server handle, */ | ||||
LPCSTR lpszDocName; | /* address of string for document name | */ | |||
LPOLESERVERDOC lpdoc; | /* address of 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 the server is started with the /Embedding filename option or when it creates or opens a document that is not requested by the library.
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.
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.
If the function is successful, the return value is OLE_OK. Otherwise, it is an error value, which may be one of the following:
OLE_ERROR_ADDRESS
OLE_ERROR_HANDLE
OLE_ERROR_MEMORY
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 OleRegisterServerDoc. Instead, the server should return a pointer to the OLESERVERDOC structure through the parameter to the relevant function.