Using IProcessInitializer

Hi,

We are currently trying to use IProcessInitializer in our COM+ components in order to perform some preparation/cleanup of resources when dllhost is loaded/unloaded. We can't find too much actual information about people using it so it's a bit hard to try and figure out how it works.

We are running on Windows XP SP2 using Delphi 7 (not .NET, it's for a standard win32 COM+ dll component). I know it's not VS but... my problem is not related to the development platform as far as I know.

When reading the type library of comsvcs.dll, in XP SP2, there is no such interface as IProcessInitializer. However it is present in the same file in Windows 2003... Technically, according to the MSDN articles, it should be here starting from Windows 2000.

I've read somewhere that you should be able to just add the definition of IProcessInitializer to your own type library and implement it. See:http://groups.google.ca/group/microsoft.public.platformsdk.complus_mts/browse_thread/thread/6f27e5f55b002311/4a62f7407d5edeb7?lnk=st&q=com%2B+iprocessinitializer+not+called&rnum=2&hl=en#4a62f7407d5edeb7

We tried that but the startup() and shutdown() methods are never called. We have also turned on the InitializesServerApplication parameter on a test component so that it would call IProcessInitializer's methods upon loading/unloading but we still can't get anything to work.

Has anyone succesfully used IProcessInitializer on Windows XP SP2? If so, how?

Thanks a lot, we've been stuck on this for a while now and I don't really know where to look anymore...

[2037 byte] By [Goodie] at [2008-2-16]
# 1
This is a known issue on XP. I recommend contacting Microsoft Support to obtain the latest COM+ patch and the related steps to fix this issue.
FlorinLazar-MSFT at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Transactions Programming...
# 2

The COM+ Integration feature of the Windows Communication Foundation leverages the IProcessInitializer capability. Because of the known issue with this on Windows XP SP2, a fix was produced and is available for download and is available for download here:

http://www.microsoft.com/downloads/details.aspx?familyid=86B93C6D-0174-4E25-9E5D-D949DC92D7E8&displaylang=en

Applying this should result in the methods being called reliably.

Andy.

AndyMilligan at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Transactions Programming...
# 3

Hi,

First of all thanks for help, I downloaded and installed the required rollup package. However, now I am facing the following problem:

- When I start the application in debug mode, it starts and then shuts down on its own and for half a millisecond I see the break point enabled on the method, just as if it was trying to run it...
- In the event log, I get the following error:

Error Code = 0x80004002 : No such interface supported
COM+ Services Internals Information:
File: d:\qxp_slp\com\com1x\src\comsvcs\srgtapi\csrgtserv.cpp, Line: 116
Comsvcs.dll file version: ENU 2001.12.4414.310 shp

so right now my component is not working and my comsvcs.dll file still does not have IProcessInitializer declared in it, so I declared the interface and its methods in my own dll with the GUID as it should be in comsvcs.dll

Any idea what I'm not doing right?

Thanks,

Goodie

Goodie at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Transactions Programming...
# 4

Well in the end I got it to work using a small sample dll created from scratch.

the 'interface not supported' error appears when I try to run it against a project with classes that inherit from others etc... so it's possible that I did something wrong when I tried to add IProcessInitializer on top of these, or that my base class needs to implement it so that the others can use it as well...

Thanks a lot for all the help.

Goodie

Goodie at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Transactions Programming...

Software Development for Windows Vista

Site Classified