Closed d2phap closed 6 months ago
Hi,
It's already defined here https://github.com/smourier/DirectN/blob/master/DirectN/DirectN/Generated/IPrintDocumentPackageTargetFactory.cs
Oh, I try to create new instance of PrintDocumentPackageTargetFactory
with the below code, but it cannot find its definition. I'm following this sample code
Or this is not the correct way?
var fac = new ComObject<IPrintDocumentPackageTargetFactory>(
(IPrintDocumentPackageTargetFactory)new PrintDocumentPackageTargetFactory()
);
PrintDocumentPackageTargetFactory
is a native (C/C++) type that is just used to define a CLSID which value is 348ef17d-6c81-4982-92b4-ee188a43867
a defined in %ProgramFiles(x86)%\Windows Kits\10\Include\10.0.22621.0\um\DocumentTarget.h
as given by https://www.magnumdb.com/search?q=PrintDocumentPackageTargetFactory
So to get a reference to the IPrintDocumentPackageTargetFactory
COM interface, you can use a code similar to this:
var PrintDocumentPackageTargetFactory = new Guid("348ef17d-6c81-4982-92b4-ee188a43867a");
var type = Type.GetTypeFromCLSID(PrintDocumentPackageTargetFactory);
var factory = (IPrintDocumentPackageTargetFactory)Activator.CreateInstance(type);
Thanks a lot!
Hi @smourier,
I'm playing with Direct2D print control, I cannot find
PrintDocumentPackageTargetFactory
class in DirectN. Can you please add it? Thank you!