Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


ID: 23033, CoGetServerPID

by Jon Robertson Email: Anonymous


Takes a COM Object and return the Process ID of the server that is hosting the object.
Download Details
FTP  download also available
CDN Login Required to Download. (You will be redirected to the login page if you click on the Download Link)
To download this, you must have registered:
A free membership

For Delphi, Version 6.0  to 6.0 291 downloads
Copyright: No significant restrictions


Size: 1,565 bytes
Updated on Thu, 17 Feb 2005 13:39:29 GMT
Originally uploaded on Tue, 15 Feb 2005 12:07:13 GMT
SHA1 Hash: DCA8C754CE4D6DE86C6E53A60CC8934BFB2C3D41
MD5 Hash: D767E7283DECB4408D7C0DBDA8F17A34

    Explore the files in this upload

Description
CoGetServerPID will take a COM Object and return the Process ID of the server that is hosting the object.

This code was converted from Kim Gräsman's C version. Please see Kim's web page for additional credits.
The web page is at http://www.winwonk.com/writing/cogetserverpid/

Thanks to Robert Marquardt for assisting with the conversion. Thanks to Project JEDI (http://www.delphi-jedi.org/) for all of their conversion work!

I use this like so:

var
WordApp: OleVariant;
WordPID: DWORD;
begin
WordApp := CreateOleObject('Word.Application');
OleCheck(CoGetServerPID(FWordApp, dwWordPID));

Although it's a hack, it works great!
Disclaimer: Actually, I've only tested it with Delphi 6.
Your mileage will vary.

   Latest Comments  View All Add New

Move mouse over comment to see the full text

Could not retrieve comments. Please try again later.

Server Response from: ETNACDC04