469,336 Members | 5,257 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,336 developers. It's quick & easy.

What are com_record objects

Hi,

I want to connect to a com object with win32.client.
Through this com object a have to connect to an other device with object.Connect(struct IPADDRESS_STRUCT * ip)

the struct IPADDRESS_STRUCT looks like this:

Byte Offset Name Type Length (Bytes) Description
0 b1 BYTE 1 Byte 1 of an internet address
1 b2 BYTE 1 Byte 2 of an internet address
2 b3 BYTE 1 Byte 3 of an internet address
3 b4 BYTE 1 Byte 4 of an internet address

Because Python doesn't have structs like C, I tried to do it with a class (C structs are classes with no private) and with pack but I always get the error message "Only com_record objects can be used as records"

I'm new in the python language but I couldn't find anything about structs or com_records in python on the internet.

Does anyone know how to do this?

Kind regards,
Gijs

--
This message has been scanned for viruses and
dangerous content by Network Sentry, and is
believed to be clean.
http://www.networksentry.co.za

Jul 19 '05 #1
1 1893
Python does have struct module that allows you to create
C-style structures.

Googling for "python struct" give us:

http://docs.python.org/lib/module-struct.html

I use it a lot to interface to COM object and to call
methods in .DLLs.

Larry Bates
Gijs Korremans wrote:
Hi,

I want to connect to a com object with win32.client.
Through this com object a have to connect to an other device with object.Connect(struct IPADDRESS_STRUCT * ip)

the struct IPADDRESS_STRUCT looks like this:

Byte Offset Name Type Length (Bytes) Description
0 b1 BYTE 1 Byte 1 of an internet address
1 b2 BYTE 1 Byte 2 of an internet address
2 b3 BYTE 1 Byte 3 of an internet address
3 b4 BYTE 1 Byte 4 of an internet address

Because Python doesn't have structs like C, I tried to do it with a class (C structs are classes with no private) and with pack but I always get the error message "Only com_record objects can be used as records"

I'm new in the python language but I couldn't find anything about structs or com_records in python on the internet.

Does anyone know how to do this?

Kind regards,
Gijs

--
This message has been scanned for viruses and
dangerous content by Network Sentry, and is
believed to be clean.
http://www.networksentry.co.za

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by Peter Morris | last post: by
9 posts views Thread by gulu man | last post: by
100 posts views Thread by E. Robert Tisdale | last post: by
51 posts views Thread by jacob navia | last post: by
21 posts views Thread by Helge Jensen | last post: by
9 posts views Thread by pamelafluente | last post: by
4 posts views Thread by mattG | last post: by
89 posts views Thread by Tubular Technician | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Marylou17 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.