473,385 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Convert PyIDispatch object to struct IDispatch*

I am trying to use ctypes to call dll functions. One of the functions
requires argument "struct IDispatch* ". I do have a PyIDispatch object
in python. How can I convert this "PyIDispatch object" to "struct
IDispatch* "?

Thanks in advance.
Apr 10 '08 #1
3 2715
En Thu, 10 Apr 2008 18:45:04 -0300, Huayang Xia <hu*********@gmail.com>
escribió:
I am trying to use ctypes to call dll functions. One of the functions
requires argument "struct IDispatch* ". I do have a PyIDispatch object
in python. How can I convert this "PyIDispatch object" to "struct
IDispatch* "?
I think a PyIDispatch object is an IDispatch* itself.
But you'll get better answers from the python-win32 list:
http://mail.python.org/mailman/listinfo/python-win32

--
Gabriel Genellina

Apr 11 '08 #2
On Apr 11, 12:15 am, "Gabriel Genellina" <gagsl-...@yahoo.com.ar>
wrote:
En Thu, 10 Apr 2008 18:45:04 -0300, Huayang Xia <huayang....@gmail.com>
escribió:
I am trying to use ctypes to call dll functions. One of the functions
requires argument "struct IDispatch* ". I do have a PyIDispatch object
in python. How can I convert this "PyIDispatch object" to "struct
IDispatch* "?

I think a PyIDispatch object is an IDispatch* itself.
But you'll get better answers from the python-win32 list:http://mail.python.org/mailman/listinfo/python-win32

--
Gabriel Genellina
Thanks for the info.

To call a dll function, it needs a C style IDispatch*. PyIDispatch is
a python wrapped one. I found a reference from:

http://svn.python.org/projects/ctype...com_interop.py

which shows how to convert C style to python style. Unfortunately i
need the reversed version.

I will post the question to python-win32.
Apr 11 '08 #3
Huayang Xia wrote:
On Apr 11, 12:15 am, "Gabriel Genellina" <gagsl-...@yahoo.com.ar>
wrote:
>En Thu, 10 Apr 2008 18:45:04 -0300, Huayang Xia <huayang....@gmail.com>
escribió:
>>I am trying to use ctypes to call dll functions. One of the functions
requires argument "struct IDispatch* ". I do have a PyIDispatch object
in python. How can I convert this "PyIDispatch object" to "struct
IDispatch* "?
I think a PyIDispatch object is an IDispatch* itself.
But you'll get better answers from the python-win32 list:http://mail.python.org/mailman/listinfo/python-win32

--
Gabriel Genellina

Thanks for the info.

To call a dll function, it needs a C style IDispatch*. PyIDispatch is
a python wrapped one. I found a reference from:

http://svn.python.org/projects/ctype...com_interop.py

which shows how to convert C style to python style. Unfortunately i
need the reversed version.

I will post the question to python-win32.
I've had a quick look at the PyIDispatch source and I can't see any obvious
way in which the underlying IDispatch is exposed. May have missed something,
but it's possible that there's not way out.

TJG
Apr 11 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Matt Smith | last post by:
hi again all, last questions for today.... (1) what do i have to import/type to be able to run GetIDsOfNames on a selected function ? I cant seem to find the module PyIDispatch anywhere, and...
3
by: Roger That | last post by:
Hi, I am trying to use the function "CreateStreamOnHGlobal" from python code (I need to pass an IStream object to MSXML, like I do in C++ code). I was able to retrieve a pointer on the IStream...
0
by: Pawel Janik | last post by:
Hello. I'm writing an application that calls com components. One of out parameters returns variant or type VT_DISPATCH, thast maps come C++ structure. This parameter is of System.__ComObject...
9
by: Kurt | last post by:
Hi I was trying to get this VB type code to work in C Sub SetColumns_Example( Dim ol As Outlook.Applicatio Dim MyFolder As MAPIFolde Dim itms As Item Dim itm As Objec Dim dtmStart As Date,...
26
by: yb | last post by:
Hi, Is there a standard for the global 'window' object in browsers? For example, it supports methods such as setInterval and clearInterval, and several others. I know that w3c standardized...
7
by: dwandless | last post by:
I have successfully installed a BHO in IE7. Using C#. Now I'm trying to figure out how to trap various events. onkeypress, oncut, oncontextmenu, etc. I have tried calling in various...
5
by: bg_ie | last post by:
Hi, I wish to write a Python wrapper for my C# COM object but am unsure where to start. I have a dll and a tlb file, and I can use this object in C via the following code - // ConsolApp.cpp :...
2
by: Philip Daniels | last post by:
I am doing some work with a client API via COM interop. I have reached the situation where after this call to their API: object someObj = con.Peek(1); "someObj" contains some type of COM...
6
by: Vincent Finn | last post by:
Hi, I have what I thought was a simple question but I can't find an answer. I need to access (create) unmanaged C++ classes in C#. They aren't COM and they aren't struct just simple classes. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.