472,981 Members | 1,252 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,981 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 9913
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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.