[DUG] How to retrive com object runtime version numberspecifiedintypelib?

Conor Boyd Conor.Boyd at trimble.co.nz
Thu Apr 5 14:52:55 NZST 2007


Depends on what wheel you're trying to reinvent.
 
To take one example, if your COM server object is on another machine,
surely there is the potential for the type library on your client
machine to not match the type library of the server object that you're
trying to connect to.  Hence our use of a specific version function
exposed explicitly by the COM server object.
 
I agree that on the same PC, then the number in the typelib could be
what you're looking for.
 
Anyways, with a bit of googling, here are some things you could look at:
 
The ITypeLib:GetLibAttr interface/function:
http://msdn2.microsoft.com/en-us/library/ms221641.aspx
Appears to return a pointer to a record with Major and Minor version
numbers.
 
The TComServerObject class has a TypeLib property which returns an
ITypeLib interface.
 
No idea whether that's accessible in your case or not, but you can look
into it.
 
HTH,
 
C.

________________________________

From: delphi-bounces at delphi.org.nz [mailto:delphi-bounces at delphi.org.nz]
On Behalf Of Leigh Wanstead
 
Yes, from a COM client.
 
I thought that version information is already in the typelib. I don't
want to reinvent the wheel.

	-----Original Message-----
	From: delphi-bounces at delphi.org.nz
[mailto:delphi-bounces at delphi.org.nz]On Behalf Of Conor Boyd
	 
	Do you mean from a COM client?
	 
	Not sure if there is a way.  We just have a method on the COM
server object which returns a version number of use to us.
	 
	HTH,
	 
	C.
	 
	P.S.  I know it's less of an issue these days, but with all due
respect, your bitmap would have been better sent (and just as readable)
as a 20KB JPEG or a 4KB PNG...

________________________________

	From: delphi-bounces at delphi.org.nz
[mailto:delphi-bounces at delphi.org.nz] On Behalf Of Leigh Wanstead
	 
	How to retrive com object runtime version number specified in
typelib? I have enclosed a bitmap file for your reference.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.adventureeducation.co.nz/pipermail/delphi/attachments/20070405/5d98702b/attachment-0001.html


More information about the Delphi mailing list