473,394 Members | 1,821 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,394 software developers and data experts.

ctypes listing dll functions

hi all and before I start I apologise if I have this completely muddled
up but here goes.

I'm trying to call functions from a dll file in a python script but I
can't work out what functions are available. I'm using ctypes. I've
tried using dir(ctypes_object) but the resultant output looks like a
list of standard functions and not the ones I'm looking for.

Also how can I tell if the dll was written in C or C++ as I understand
C++ dlls can't be used.

I have a header file that starts;

#ifndef __DIRAC__
#define __DIRAC__
// Prototypes

const char *DiracVersion(void);
void *DiracCreate(long lambda, long quality, long numChannels,
float sampleRate, long (*readFromChannelsCallback)(float **data, long
numFrames, void *userData));
void *DiracCreate(long lambda, long quality, long numChannels,
float sampleRate, long (*readFromChannelsCallback)(float *data, long
numFrames, void *userData));
long DiracSetProperty(long selector, long double value, void
*dirac);
long double DiracGetProperty(long selector, void *dirac);
void DiracReset(bool clear, void *dirac);
long DiracProcess(float **audioOut, long numFrames, void *userData,
void *dirac);
long DiracProcess(float *audioOut, long numFrames, void *userData,
void *dirac);
void DiracDestroy(void *dirac);
long DiracGetInputBufferSizeInFrames(void *dirac);

I would have thought that DiracCreate, DiracSetProperty etc were all
callable functions. As you may have guessed I'm don't do much work in
C...

Thanks, MW.

Sep 8 '06 #1
1 10095
ma*********@googlemail.com wrote:
>
hi all and before I start I apologise if I have this completely muddled
up but here goes.

I'm trying to call functions from a dll file in a python script but I
can't work out what functions are available. I'm using ctypes. I've
tried using dir(ctypes_object) but the resultant output looks like a
list of standard functions and not the ones I'm looking for.
As far as I know, there is no way with ctypes to enumerate the functions
exported by a DLL. If you have Visual C++, you can use link.exe to do
this:
link /dump /exports xxxxx.dll
>Also how can I tell if the dll was written in C or C++ as I understand
C++ dlls can't be used.
Well, DLLs that use C++ features cannot be used. If the exported names are
"decorated", then they can't be used.
>I have a header file that starts;

#ifndef __DIRAC__
#define __DIRAC__

// Prototypes

const char *DiracVersion(void);
void *DiracCreate(long lambda, long quality, long numChannels,
float sampleRate, long (*readFromChannelsCallback)(float **data, long
numFrames, void *userData));
void *DiracCreate(long lambda, long quality, long numChannels,
float sampleRate, long (*readFromChannelsCallback)(float *data, long
numFrames, void *userData));
That's called "function overloading": two functions with the same name but
slightly different parameters. That is only available with C++, so I'm
afraid you are out of luck. You may be able to use SWIG to generate an
interface for this; I've had good luck with SWIG.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Sep 9 '06 #2

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

Similar topics

6
by: Ian Sparks | last post by:
I have a python file with a number of functions named with the form doX so : doTask1 doThing doOther The order these are executed in is important and I want them to be executed top-down. They...
1
by: Thomas Heller | last post by:
ctypes 0.9.1 released - Sept 14, 2004 ===================================== Overview ctypes is a ffi (Foreign Function Interface) package for Python 2.3 and higher. ctypes allows to call...
19
by: Thomas Heller | last post by:
ctypes 0.9.2 released - Oct 28, 2004 ==================================== Overview ctypes is a ffi (Foreign Function Interface) package for Python 2.3 and higher. ctypes allows to call...
0
by: marc.wyburn | last post by:
hi all and before I start I apologise if I have this completely muddled up but here goes. I'm trying to call functions from a dll file in a python script but I can't work out what functions are...
1
by: Massi | last post by:
Hi everyone, I have a program which is written in C and interfaced with python via Ctypes. The functions I call print stuff out to the console, using the usual function printf. I would like to...
6
by: =?Utf-8?B?LnBhdWwu?= | last post by:
how do i list all available functions in an unmanaged .dll? i tried using reflection, but that seems to only work with managed assemblies
9
by: Matt | last post by:
Hi friends, Okay so well, I have quite a problem right now with a file stream. What I am doing is to use the Cannon SDK dlls to get control over my old Cannon A60 Camera for some surveillance...
0
by: gianluca | last post by:
I've a problem with dll function colled with python/ctypes. My functions (C) requred a typedef int "value_type" in tree different way: same as value_type; - mydll.foo1(value_type) same as...
2
by: Jean-Paul Calderone | last post by:
On Mon, 30 Jun 2008 09:13:42 -0700 (PDT), gianluca <geonomica@gmail.comwrote: POINTER takes a class and returns a new class which represents a pointer to input class. pointer takes an instance...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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: 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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.