|
Message Removed
modified 8-Dec-15 2:03am.
|
|
|
|
|
Message Removed
modified 8-Dec-15 2:03am.
|
|
|
|
|
Hello, how do I use Dispatcher.BeginInvoke() to work with fuction that doesn't returns and doesn't get any parameters ?
lets say :
"public void AddInk()
{
}"
I am inside a class and I am trying to use threading from a main window constructed on WPF in order to make the AddInk() work on the background.
from the main window I called :
Thread addI = new Thread(MyClass.ThreadInk);
public void ThreadInk()
{
//checks the CheckAcess() and using Dispatcher to call AddInk if CheckAcess() is false else: just call AddInk normally
}
I understand I should work with delegate on the Dispatcher,can someone give me an example how exactly and if I am doing it ok ?
B.when can I use Thread.Sleep() (I mean in which part of the program that I have described ?)
modified 6-Dec-15 12:34pm.
|
|
|
|
|
Try:
if (Dispatcher.CheckAccess())
{
AddInk();
}
else
{
Dispatcher.BeginInvoke((Action)AddInk);
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
how Select a DataGridView row after TextBox value c#
the secund colum datagridview the exemple:
for (int i=0;i<dataGridView1.RowCount-1;i++)
{
if (dataGridView1.Rows[i].Cells[2].Value.ToString().Trim() == toolStripTextBox1.Text)
{
dataGridView1.Rows[i].Selected = true;
}
else
{
dataGridView1.Rows[i].Selected = false;
}
}
that code no this to work for secund
column of the datagridview
|
|
|
|
|
Um.
The Second column of the DataGridView would be Cells[1].Value not Cells[2].Value - C# uses zero based indexes, not one based.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
so I got the code from the msdn website:
https:
and since i do not have the wav file specified in the original code i downloaded my own wav file and inserted the address of it.
the program works but it prints out something completely different words that are not even in the wav file audio.
here is the code
using System;
using System.Globalization;
using System.IO;
using System.Speech;
using System.Speech.AudioFormat;
using System.Speech.Recognition;
using System.Threading;
namespace InputExamples
{
class Program
{
static bool completed;
static void Main(string[] args)
{
using (SpeechRecognitionEngine recognizer =
new SpeechRecognitionEngine(new CultureInfo("en-US")))
{
Grammar dictation = new DictationGrammar();
dictation.Name = "Dictation Grammar";
recognizer.LoadGrammar(dictation);
recognizer.SetInputToWaveStream(
File.OpenRead(@"C:\Users\Qasim\Desktop\wav3.wav"));
recognizer.SpeechRecognized +=
new EventHandler<SpeechRecognizedEventArgs>(
SpeechRecognizedHandler);
recognizer.RecognizeCompleted +=
new EventHandler<RecognizeCompletedEventArgs>(
RecognizeCompletedHandler);
Console.WriteLine("Starting asynchronous recognition...");
completed = false;
recognizer.RecognizeAsync(RecognizeMode.Multiple);
while (!completed)
{
Thread.Sleep(333);
}
Console.WriteLine("Done.");
}
Console.WriteLine();
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
}
static void SpeechRecognizedHandler(
object sender, SpeechRecognizedEventArgs e)
{
if (e.Result != null && e.Result.Text != null)
{
Console.WriteLine(" Recognized text = {0}", e.Result.Text);
}
else
{
Console.WriteLine(" Recognized text not available.");
}
}
static void RecognizeCompletedHandler(
object sender, RecognizeCompletedEventArgs e)
{
if (e.Error != null)
{
Console.WriteLine(" Error encountered, {0}: {1}",
e.Error.GetType().Name, e.Error.Message);
}
if (e.Cancelled)
{
Console.WriteLine(" Operation cancelled.");
}
if (e.InputStreamEnded)
{
Console.WriteLine(" End of stream encountered.");
}
completed = true;
}
}
}
|
|
|
|
|
I suggest you create a sample audio file with one sentence with only a few common words, with each word pronounced as distinctly as possible.
Then run your program using that file, and see what text it produces.
That may help you diagnose what's going on.
«I want to stay as close to the edge as I can without going over. Out on the edge you see all kinds of things you can't see from the center» Kurt Vonnegut.
|
|
|
|
|
I am having a c# application and that application is loading c# dll dynamically.Now the processing going in dll is to be shown on application gui .How can we acheve this.I m new to c#.Please help.
|
|
|
|
|
Member 9322887 wrote: Now the processing going in dll is to be shown on application gui Add a callback-method to the signature of your "Load" method (an Action ). Call this method from within the Load-method every 500 ms or so, whenever you think the GUI needs be updated.
From your GUI-thread, launch a thread that finds the correct type in your DLL and have it call the Load method using reflection. Whenever the callback is fired, synchronize with the mainthread and update the GUI.
If you don't like the concept of a callback-method, then create an "UpdateUI" event on the same class that the caller could subscribe to.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
And frankly, you could be doing pretty much anything here!
You need to tell us what you are doing, how you are doing it ("why" as well maybe) and probably show us relevant code fragments so we can see what is going on. At the moment, we are blind - which means we can't help you see either!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Don't post the same question in two places - all you will do is duplicate work and annoy people. Pick either the C# forum or the Q&A and stick with it.
Annoyed people are less likely to be helpful than happy ones...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Can anyone share code for sending emails with and without using third party DLL?
Imran Ahmed
|
|
|
|
|
It sounds like you are ordering at MacDonalds. The forum is mainly aimed at helping with questions, not requests to share code.
People that want to share their code send them in as articles or tricks. The code for sending an email without using a third party dll can be found in the documentation, as well as in several tutorials.
Good luck.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
|
Can anyone share code for code for sending SMS for a mobile number in INDIA with and without using third party DLL?
Imran Ahmed
|
|
|
|
|
|
Only 6 pages[^] of stuff here on CodeProject on that subject
|
|
|
|
|
Hi!
I have one question with working ABCPDF library.
I manually instaled ABCpdf.dll and used on my site.
I copied this dll to my bin folder in project from trial version programm, that was downloaded from http://www.websupergoo.com/download.htm and installed on my computer(i copied ABCpdf.dll, ABCpdf10-32.dll from folder C:\Program Files\WebSupergoo\ABCpdf .NET 10.1 after i have installed it on my computer)
I had to conver pdf file inti tiff, and used this library this way
Doc theDoc = new Doc();
theDoc.Read("C:\\pdf\\" + sec_part + ".pdf");
theDoc.Rendering.ColorSpace = XRendering.ColorSpaceType.Rgb;
theDoc.Rendering.BitsPerChannel = 2;
theDoc.Rendering.DotsPerInchX = 200;
theDoc.Rendering.DotsPerInchY = 400;
int n = theDoc.PageCount;
for (int i = 1; i <= 1; i++)
{
theDoc.PageNumber = i;
theDoc.Rect.String = theDoc.CropBox.String;
theDoc.Rendering.SaveAppend = (i != 1);
theDoc.SetInfo(0, "ImageCompression", "0");
theDoc.Rendering.Save("C:\\pdf\\" + sec_part+".tiff");
}
theDoc.Clear();
it works fine, but...
Is it right? In one month won't the license end and my program stop work?
I really worry about it...
|
|
|
|
|
Talk to the people who created the DLL - they know what their licence covers, and what will happen at the end of the period.
And if it will, then they are the people you will have to pay to keep it working...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Kindly remove registry after 1 month of manual installation or write that command on notepad/Editor and save (.bat) extension like test.bat and run this bat file.
write below code on notepad :
@echo off
cls
echo Deleting WebSuperGoo Registry
echo.
REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\WebSupergoo" /F
REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\WebSupergoo" /F
pause
:end
|
|
|
|
|
And what does that do?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
="1.0"="utf-8"
<MAIN>
<Items>
<Name>name1</Name>
<Data>data1</Data>
<Category>category1</Category>
</Items>
<Items>
<Name>name2</Name>
<Data>data2</Data>
<Category>category2</Category>
</Items>
<Items>
<Name>name3</Name>
<Data>data3</Data>
<Category>category2</Category>//same category as above
</Items>
...
...
<Items>
<Name>name20</Name>
<Data>data20</Data>
<Category>category16</Category>
</Items>
</MAIN>
Now I need to create an List with category1, category2, ... upto what the categories is there on Category Node, need to create a separate Lists of each category to store the item name and every item list will have data of the item so I can retrieve them for my use.
From above sample xml I need the same category items in a single List
Items and Category count is fully dynamic. How to do this dynamically?
|
|
|
|
|
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Please, try to explain again, but this time remembering that we have no context in which to work unless you explicitly tell us!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|