Ekinlikler
19 Kas 23 - 21 Kas 23
Microsoft Ignite'a çevrimiçi olarak katılarak güçlü yapay zeka ve Bulut çözümleriyle ihtiyacınız olan rekabet avantajını elde edin.
Hemen kaydolunBu tarayıcı artık desteklenmiyor.
En son özelliklerden, güvenlik güncelleştirmelerinden ve teknik destekten faydalanmak için Microsoft Edge’e yükseltin.
Describes how to initialize an XPS OM, which allows a program to create an XPS document.
The interfaces of the XPS Document API are created by an IXpsOMObjectFactory interface. To obtain a pointer to an IXpsOMObjectFactory that can be used in your program, call CoCreateInstance.
Before using the following code examples in your program, read the disclaimer in Common XPS Document Programming Tasks.
The following example creates the object factory that will be used to create XPS OM interfaces in other examples.
IXpsOMObjectFactory *xpsFactory;
HRESULT hr = S_OK;
// Init COM for this thread if it hasn't
// been initialized, yet.
hr = CoInitializeEx(0, COINIT_MULTITHREADED);
hr = CoCreateInstance(
__uuidof(XpsOMObjectFactory),
NULL,
CLSCTX_INPROC_SERVER,
__uuidof(IXpsOMObjectFactory),
reinterpret_cast<LPVOID*>(&xpsFactory));
if (SUCCEEDED(hr))
{
// Make sure that you got a pointer
// to the interface.
// Use object factory...
// ... and release when done
xpsFactory->Release();
}
// Uninitialize COM when finished
CoUninitialize();
You can make your program more efficient by obtaining a pointer to an IXpsOMObjectFactory interface the first time that you need to call IXpsOMObjectFactory to create an interface, and then saving the pointer for use in other areas of the program. When the program no longer needs the object factory, or will not need it for a while, the pointer can be released.
Next Steps
Used in This Section
For More Information
Ekinlikler
19 Kas 23 - 21 Kas 23
Microsoft Ignite'a çevrimiçi olarak katılarak güçlü yapay zeka ve Bulut çözümleriyle ihtiyacınız olan rekabet avantajını elde edin.
Hemen kaydolun