473,394 Members | 1,761 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.

send event from extension?

Hi everybody,

I'd like to create an event which I have to post/set
within an extension (new frame signal from a camera).
In python I would like to react on this event.
How could I create and post the event in c and
how could I receive it in a python event handler
routine done with the win32event module?

Thanks for any answer,

Markus
Jul 18 '05 #1
2 2423
You could use win32event.CreateEvent and pass the handle into your
extension,
call SetEvent in the c code, and use win32event.WaitForSingleObject to wait
for
the signal. Alternately, you could create a named event and call OpenEvent
to
get a handle instead of passing it around.
hth
Roger

"Markus von Ehr" <vo****@ipm.fhg.de> wrote in message
news:c9**********@news2.rz.uni-karlsruhe.de...
Hi everybody,

I'd like to create an event which I have to post/set
within an extension (new frame signal from a camera).
In python I would like to react on this event.
How could I create and post the event in c and
how could I receive it in a python event handler
routine done with the win32event module?

Thanks for any answer,

Markus

Jul 18 '05 #2
Roger Upole schrieb:
You could use win32event.CreateEvent and pass the handle into your
extension,
call SetEvent in the c code, and use win32event.WaitForSingleObject to wait
for
the signal. Alternately, you could create a named event and call OpenEvent
to
get a handle instead of passing it around.
hth
Roger

"Markus von Ehr" <vo****@ipm.fhg.de> wrote in message
news:c9**********@news2.rz.uni-karlsruhe.de...
Hi everybody,

I'd like to create an event which I have to post/set
within an extension (new frame signal from a camera).
In python I would like to react on this event.
How could I create and post the event in c and
how could I receive it in a python event handler
routine done with the win32event module?

Thanks for any answer,

Markus


Hi Roger,

I don't know how to pass the handle. Is only the event.handle
important? And how to wait for the event?
Do I have to verify that the correct event fired my
WaitForSingleObject?
Can you help me?
I do the following in my python code:

import win32event
..
..
..
evt = win32event.CreateEvent(None, 0, 0, None)

# pass event to c-extension
cam_ext.SetEvent(evt.handle)
# and wait for the event
win32event.WaitForSingleObject(evt)
###########################################

// c-extension

int event;

PyObject *cam_ext_SetEvent(PyObject *pSelf, PyObject *pArgs)
{

if (!PyArg_ParseTuple(pArgs, "i", &event))
return NULL;

Py_INCREF(Py_None);
return Py_None;
}
// Set the event

::SetEvent(event);

Do you think it's correct? generally SetEvent needs an event object and
not only a number?

Thanks for hints,

Markus
Jul 18 '05 #3

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

Similar topics

4
by: M P | last post by:
Hi! Need to interpret this errors when installing FrontPage Extension 2002 on Windows 2000 SP4. Event Type: Error Event Source: MsiInstaller
4
by: jas | last post by:
I have a basic client/server socket situation setup....where the server accepts a connection and then waits for commands. On the client side, I create a socket, connect to the server...then I...
6
by: harvie wang | last post by:
Hi, How to send a message to every window(include child window), I use SendMessage ,but It can't do that. class frmA { public const int WM_test = 0x400 + 1; protected override void...
7
by: moondaddy | last post by:
I have a user control being used instead of a frame page. when the user clicks on a menu item I need to send the ID (integer value) of that menu as a parameter in the postback of the user control...
5
by: Andreas | last post by:
I am working with three computers, my developing computer, a Web Server and a Mail Server (Exchange). I am trying to send a email from the Web Server via the Mail Server to a valid email address...
2
by: louise raisbeck | last post by:
hi, if i cause the onclick event to fire with an ImageButton I can send CommandArgument which I find really handy to grab some relevant value (which means i can reuse code for many buttons and...
2
by: kgadia | last post by:
Hi, I have implemented global exception handler using http module by intercepting the Error event. The code works fine on my machine but the error event fails to fire when deployed on the...
1
by: One Lazy Russian | last post by:
Thanks in advance to anyone that can help. I created an extension for firefox that acts as a bookmarklet for Gmail, Yahoo, and all standalone clients (via the mailto function). Upon clickin on...
6
by: David Thielen | last post by:
Hi; This works fine on my development system but fails on IIS on Win 2003. I have requests for filename.txt, filename.rtf, etc that must go to my ASP.NET code. I have the following in my...
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:
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.