COM server usage question

P

Propad

Hello everybody,
I created a simple COM server, by copy and paste of the first example
from the book by Mark Hammond. I registered the server, and was able
access its functionallity from another python script, and from Word.
Then I tried accessing the server from another tool (which is my real
task). The problem was, it was not in the dropdown list of servers
usable by the tool. The alternative was to specify a position of the
server, by giving in the location of a .exe or .dll or .tlb file.
So after browsing my registry and this newsgroup for a (long) while,
my conclusion is:
-all com servers in the mentioned drop-down list are entries in the
HKEY_CLASSES_ROOT\TypeLib registry entry
-in order to get my server into that list, I have to somehow specify
that before registration. My guess would be I need to somehow use the
_reg_options_ attribute. But if, how?
-as an alternative I could write an *.IDL file, compile it to *.tbl,
and feed that into the calling tool. I've seen the example given at
the c_types page. But how do I know what entries to put into the *.idl
file? Meaning specifically the GUID-s. I'm sure theese are allready
somewhere in the registry, so I can't just go and create new ones. Can
the GUID-s for the type library, interface and implementig class be
derived from the GUID I used when creating the server? And also, where
do I get a working midl - compiler? I found two on my computer, but
neither seems to be working, asking for a cl compiler.
I thank you kindly for your help.
Regards,
Nenad Propadovic
 
M

Mark Hammond

Propad said:
Hello everybody,
I created a simple COM server, by copy and paste of the first example
from the book by Mark Hammond. I registered the server, and was able
access its functionallity from another python script, and from Word.
Then I tried accessing the server from another tool (which is my real
task). The problem was, it was not in the dropdown list of servers
usable by the tool. The alternative was to specify a position of the
server, by giving in the location of a .exe or .dll or .tlb file.
So after browsing my registry and this newsgroup for a (long) while,
my conclusion is:
-all com servers in the mentioned drop-down list are entries in the
HKEY_CLASSES_ROOT\TypeLib registry entry
-in order to get my server into that list, I have to somehow specify
that before registration. My guess would be I need to somehow use the
_reg_options_ attribute. But if, how?
-as an alternative I could write an *.IDL file, compile it to *.tbl,
and feed that into the calling tool. I've seen the example given at
the c_types page. But how do I know what entries to put into the *.idl
file? Meaning specifically the GUID-s. I'm sure theese are allready
somewhere in the registry, so I can't just go and create new ones. Can
the GUID-s for the type library, interface and implementig class be
derived from the GUID I used when creating the server? And also, where
do I get a working midl - compiler? I found two on my computer, but
neither seems to be working, asking for a cl compiler.
I thank you kindly for your help.

At this stage, PythonCOM servers do not create a type library. Thus,
the interface is registered, but no tools that process type libraries
will be able to see it.

Mark.
 
P

Propad

Dear Mr. Hammond,
thank you for your answer, and even more for making Python on win32
possible at all. I do realise my question resembles some previous
postings, and the answer you gave me was allready given.
However, I'll try to restate my question in other words: could anybody
give me a pointer to any kind of literature enabling me to produce my
own type library? Some easy to understand beginners guide to COM,
explaining also the typical registry entries? Well if there are no
tlb-s in win32com, I just might manage to get them in there :)
Thanks, all you kind people.
Nenad Propadovic
P.S. Starting a contract work at BMW, I just realised the penetration
of Python in the german automotive industry seems to be quite descent.
This is due to a tool-suite by a company named DSpace, which uses
Python as its scripting language...
 
L

logistix at cathoderaymission.net

Dear Mr. Hammond,
thank you for your answer, and even more for making Python on win32
possible at all. I do realise my question resembles some previous
postings, and the answer you gave me was allready given.
However, I'll try to restate my question in other words: could anybody
give me a pointer to any kind of literature enabling me to produce my
own type library? Some easy to understand beginners guide to COM,
explaining also the typical registry entries? Well if there are no
tlb-s in win32com, I just might manage to get them in there :)
Thanks, all you kind people.
Nenad Propadovic
P.S. Starting a contract work at BMW, I just realised the penetration
of Python in the german automotive industry seems to be quite descent.
This is due to a tool-suite by a company named DSpace, which uses
Python as its scripting language...

"Inside COM+ Base Services" From MS Press is the first book you should
read. It should probably be read by anyone trying to do serious COM
work. There is at least one chapter on Type Libraries in the book.

Once you get through that the library reference at
http://msdn.microsoft.com should fill in the blanks.

However, both of these references will assume you know C/C++
reasonably well (and maybe some VB on msdn).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top