I am working on a project where I need to use PowerPoint from C # .net. Initially, I always created one instance. Today I would like to run several instances. I do it like this:
Type powerpointType = Type.GetTypeFromProgID("PowerPoint.Application");
object instance1 = Activator.CreateInstance(powerpointType);
object instance2 = Activator.CreateInstance(powerpointType);
but when I request a handle to both instances, calling
hwnd = (int)powerpointType.GetProperty("HWND").GetValue(instance1, null);
then i get the same descriptor twice. I came to the conclusion that the application is launched only once, and the TaskManager confirms the following: Only one process.
How is it that only one instance of PowerPoint works, and how can I get it to work?
source
share