I have a Win32 .exe written in Delphi Seattle that implements a COM interface to a function.
I'm confused by the way the server behaves if I call CreateOleObject() from inside the program itself.
The instancing model is set to ciSingleInstance
so I would expect a new instance to be created at each call (assuming the previous instances are still running).
What actually happens is the first call does not create a new instance but the second does.
If the first call runs to completion the second instance again creates a new instance even though the program should be back to its default state.
How do I
a) force creation of a second instance on the first call, or
b) return the program to a really default state so that multiple runs to completion do not start a second instance.
CoCreateInstance
call, for the lifetime of this process". In light of this, your program appears to be working as expected. You probably run it by means other thanCoCreateInstance
, so it still waits for its one and onlyCoCreateInstance
- but once it gets it, it won't take any more, ever. – Igor Tandetnik