accessing method name from within a c-function
nhodgson at bigpond.net.au
Fri Jan 18 00:11:36 CET 2002
> Thanks for your answer, Neil. But I'm afraid calldll not really
> addresses this problem.
> The problem is, that when I use the generic method of registering a
> single function for argument conversion and dispatching as described
> in the earlier posting, all calls from python to C must pass through
> this function.
So the complete scaffolding for this is in C?
The aspect of calldll I was meaning is the collection of callable
wrappers buit up by the windll module. This is in the full dynwin download,
not in the calldll download. Each callable_function object knows its name
For your situation, I would expose the single C entry point and construct
callable wrappers in Python for each name. Then the name becomes an
additional argument to the call. This is much easier than trying to scrabble
up the Python stack (through one of those popular exception hacks) for a
stack frame holding the name being called. It will also be less costly.
More information about the Python-list