473,408 Members | 2,839 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,408 software developers and data experts.

problem with C# lock and windows2000 callback

hi, i'm having a problem using C#'s lock and windows2000's text to
speech (vtext.dll) ... basically it looks like the callback from the
TTS is violating C#'s lock, which looks very very suspicious. here are
the particulars:

i've made a form that has two buttons, one to "start speaking" and one
to "cancel speaking", and i've registered the TTS's callback message
"speech_recognized" to call my method axTextToSpeech1_SpeakingDone.

each of the methods, button1_Click (i.e. start speaking),
button2_Click (cancel speaking), and axTextToSpeech1_SpeakingDone call
handleEvent(string msg), with msg being just the name of the callback
(e.g. button1_Click).

handleEvent has a lock covering the whole method, and within that a
case statement.

if msg == "button1_Click", just calls the axTextToSpeech1.Speak

if msg == "button2_Click", just calls axTextToSpeech1.StopSpeaking

if msg == "axTextToSpeech1_SpeakingDone", just prints a message.

i've put in log messages both to std out and to file, and it seems
pretty clear that if you press the start speaking and then cancel it
while it's still speaking, the "axTextToSpeech1_SpeakingDone" method
gets called and start going through handleEvent, *even though the
cancel msg is still going through the locked code* ...

has anyone noticed anything like this before?? is it just some weird
anomaly w/ this TTS? if so, is there some other TTS i can drop into my
GUI? i've tried to download a couple of others, but couldn't get them
to work.

thanks in advance.
Nov 13 '05 #1
1 2647
spacedog,

I am assuming that when the speaking begins, it is on another thread.
Because of this, I would think that a notification is passed to that other
thread. Because of this, the handleEvent method exits quickly, and while
there is something going on in another thread, you can still get
notifications.

For this reason, the lock is very quick, because it only is in the
handleEvent method for a short amount of time in any case. It seems like
you want to lock out the method on whether or not the operation is complete.

Of course, I don't know for sure thow TTS works. I'm assuming that it
works asynchronously.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"spacedog" <qm*******@sneakemail.com> wrote in message
news:4d**************************@posting.google.c om...
hi, i'm having a problem using C#'s lock and windows2000's text to
speech (vtext.dll) ... basically it looks like the callback from the
TTS is violating C#'s lock, which looks very very suspicious. here are
the particulars:

i've made a form that has two buttons, one to "start speaking" and one
to "cancel speaking", and i've registered the TTS's callback message
"speech_recognized" to call my method axTextToSpeech1_SpeakingDone.

each of the methods, button1_Click (i.e. start speaking),
button2_Click (cancel speaking), and axTextToSpeech1_SpeakingDone call
handleEvent(string msg), with msg being just the name of the callback
(e.g. button1_Click).

handleEvent has a lock covering the whole method, and within that a
case statement.

if msg == "button1_Click", just calls the axTextToSpeech1.Speak

if msg == "button2_Click", just calls axTextToSpeech1.StopSpeaking

if msg == "axTextToSpeech1_SpeakingDone", just prints a message.

i've put in log messages both to std out and to file, and it seems
pretty clear that if you press the start speaking and then cancel it
while it's still speaking, the "axTextToSpeech1_SpeakingDone" method
gets called and start going through handleEvent, *even though the
cancel msg is still going through the locked code* ...

has anyone noticed anything like this before?? is it just some weird
anomaly w/ this TTS? if so, is there some other TTS i can drop into my
GUI? i've tried to download a couple of others, but couldn't get them
to work.

thanks in advance.

Nov 13 '05 #2

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

Similar topics

0
by: Bruce Davis | last post by:
I'm having a problem on windows (both 2000 and XP) with a multi-threaded tkinter gui application. The problem appears to be a deadlock condition when a child thread pops up a Pmw dialog window in...
0
by: Doug | last post by:
Mark, I'm using activestates version of your PythonWin in their version 2.3 of python. I've also noticed this as well with the version that was exported with version 2.2 as well. I'm going...
1
by: fc | last post by:
hi, i'm having a problem using C#'s lock and windows2000's text to speech (vtext.dll) ... basically it looks like the callback from the TTS is violating C#'s lock, which looks very very...
3
by: shyju_kambi | last post by:
hi all, please give me the logic to creat a folder lock in windows2000/Xp using c program. what i mean by folder lock is, if any one is trying to open that folder, it should ask for the password...
3
by: David | last post by:
Hi, Ive been trying to work this out for the past 2 days now and im not getting anywhere fast. The problem i have is that i am using Asynchronous sockets to create a Socket Client library....
1
by: Thomas Lerchner | last post by:
Hi! I have a problem with an UDP socket. I create socket and call BeginReceiveFrom to use the socket async. But the callback methode is being called several times with the same packet from the...
2
by: jgbid | last post by:
Hi, I'm trying to build an IP Scanner inc c# for a specific port (80) and for specific IP Ranges. For example 24.36.148.1 to 24.36.148.255 My first step was to use TcpClient, but there are...
3
by: aaron.m.johnson | last post by:
Help me understand this, please. I have an older VC++ COM DLL that I'm using in a C# project. One of the COM objects takes a callback object as a parameter so that it can spin off a thread and...
7
pod
by: pod | last post by:
Hello My OS is Windows2000 I am new to .NET I developed a C# Windows Application that connects to a MS Access database on the network using proper UNC format. It works perfectly on 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: 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...
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:
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.