Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Process and Object relationship

Status
Not open for further replies.

mattKnight

Programmer
May 10, 2002
6,222
0
36
GB
Relative newbie to COM so Please be gentle!

My problem
COM object say Foo.exe with interface IFoo,

I want to create many instances of object each running in its own unique process (i.e PID unique). that is I want to see Foo.exe many times in taskmanager.

Used smartpointers to instantiate
Used COCreateInstance to Instantiate
Used IClassFactory::CreateInstance

Am I trying to achieve something that either cannot be done or should not be done?

All thoughts gratefull accepted!

Matt
 
Hello,
As such CoCreateInstance call indirectly ur class factory CreateInstance...The exe server should be registered
via helping function :-
RegisterClassObjects(CLSCTX_LOCAL_SERVER, REGCLS_SINGLEUSE | REGCLS_SUSPENDED);

REGCLS_SINGLEUSE will cause the one class object per client..

The thing which u want can be achieved by calling CoCreateInstance with the following flags CLSCTX_LOCAL_SERVER for dwClsContext..

Each time u call a CoCreateInstance the new instance will be created..

I hope this will help u....

With Regard's
Dinesh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top