473,480 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 2098
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
3621
by: Peter Morris | last post by:
What, exactly, is ASP? Is ANY dynamically generated HTML the same as ASP? Or does ASP have to be in a particular format or language? The company I used to work for (until it went bust) was in...
6
2541
by: Alfonso Morra | last post by:
I have written the following code, to test the concept of storing objects in a vector. I encounter two run time errors: 1). myClass gets destructed when pushed onto the vector 2). Prog throws a...
9
3096
by: gulu man | last post by:
Hi, What is the substitute for COM objects in .NET? How can I create something similar to com in .net? Is it still possible? Thank you
100
5152
by: E. Robert Tisdale | last post by:
What is an object? Where did this term come from? Does it have any relation to the objects in "object oriented programming"?
51
4446
by: jacob navia | last post by:
I would like to add at the beginning of the C tutorial I am writing a short blurb about what "types" are. I came up with the following text. Please can you comment? Did I miss something? Is...
21
13779
by: Helge Jensen | last post by:
I've got some data that has Set structure, that is membership, insert and delete is fast (O(1), hashing). I can't find a System.Collections interface that matches the operations naturally offered...
9
3078
by: pamelafluente | last post by:
Hi, I was "studying" the famous (public code) BusyBox. I see the instruction: var busyBox = new BusyBox as in var busyBox = new BusyBox("BusyBox1", "busyBox", 4, "gears_ani_", ".gif",...
4
1445
by: mattG | last post by:
I have a scenario where I have these things that take up (x) number of space. I know the max number of space I will ever have is 512. I am trying to figure out a way to write a formula or...
89
5637
by: Tubular Technician | last post by:
Hello, World! Reading this group for some time I came to the conclusion that people here are split into several fractions regarding size_t, including, but not limited to, * size_t is the...
0
7039
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7080
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5326
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4770
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4476
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2992
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2977
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1296
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.