|
Thanks for the reply ravi!
Thats pretty much exactly what im looking for, it already has the C# DLLs so i can easily include in my project.
But GOLD has the same problem as COCO, it requires a grammer file, which i am not experienced enough to write, i dont know that much about C++ to write a grammer table for the whole language.
Do you know of any free available GOLD C++.cgt (Compiled Grammer Table)
|
|
|
|
|
Abydosgater wrote: Do you know of any free available GOLD C++.cgt (Compiled Grammer Table)
Sorry, I don't. Maybe you could craft your own using this[^] BNF or perhaps contact one of these[^] GOLD contributors?
/ravi
|
|
|
|
|
How to prevent the user to stop the service?
|
|
|
|
|
|
|
Acoustic wrote: what kind of service?
What difference does that make?
|
|
|
|
|
I've noticed some people a round here help people with clear malicious intent, as long as their told the answer they want to hear.
"I'm making a cafe application, that's why it can't show up in task manager"
"I'm making a service to monitor my employee's system"
etc etc
Check out the Do not allow taskmanager to close my app[^]
Guy got help despite his obvious intent.
|
|
|
|
|
It makes a huge difference. A windows service is totally different than a WCF service. Neither are like a COM service. You're not going to get a clear answer unless you explain what kind of service you're talking about.
|
|
|
|
|
Maybe, but ultimately all services reside within a process, so the question really is how do you prevent the user stopping a process?
|
|
|
|
|
|
|
...
"Well, we're getting "F"'d at work. WPF, WCF, and WWF... WTF?" --John Simmons
|
|
|
|
|
In the code, set CanStop to false.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
When the press of a button Alt + Ctrl + Delete and terminate the Service
|
|
|
|
|
hi,
i have a server application that the req from clients are answered with a seperate thread and my windows form(my user interface) is answering the user.
recently i've added a new button that would open me a savefile dialog, another button for openfiledialog and the last for folderbrowserdialog.
first button:
SaveFileDialog saveFileDialog1 = new SaveFileDialog();
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
}
sec button:
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
textBox_bak.Text = openFileDialog1.FileName;
}
third button:
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
{
}
thhere is a weired problem with first button and the sec button, when i hit them my thread won't work and won't answer to clients untill the (save or open)dialog is open
but button 3 is not like them.
|
|
|
|
|
i should mention that this problem occured in XP but not vista(i mean vista was ok!)
there should not be any difference, should be?
|
|
|
|
|
Hi,
the GUI Controls are not thread-safe; Windows requires that a Control only be
accessed by the thread that created it (normally the GUI thread for all of them, since
they typically are all linked in one big hierarchy). When other threads need to report
and show some results using the GUI, there is an Invoke mechanism, supported by
Control.InvokeRequired and the methods Control.Invoke() or BeginInvoke() methods.
if you fail to obey the rules, the GUI may seem fine for a while, for some of its Controls,
on some machines, on some operating system, but in general it is destined to fail.
final remarks:
- since NET2.0 illegal cross-thread calls throw an exception; there is a property to suppress those
and that is a very bad idea.
- also since NET2.0 there is a BackGroundWorker class that is useful in dealing with background work
needing to update the GUI.
Luc Pattyn [Forum Guidelines] [My Articles]
I use ListBoxes for line-oriented text output (not TextBoxes), and PictureBoxes for pictures (not drawings).
modified on Friday, June 10, 2011 12:19 PM
|
|
|
|
|
thanks for you'r nice answer, but i know the rules, i have userd Invokde every where that i need to point a func or obj created outside of the thread. so what is the solution? u just explain me why this happened?
u mean a way is to use background worker instead of separate thread?
|
|
|
|
|
Hi,
you need to provide more information on the situation. How many threads/threadpools/backgroundworkers are there? how many are involved in accessing Controls (even reading a property)?
you should also consider hidden threads, serving asynchronous actions such as timer events, serial port
or network data received, probably also remoting, etc.
Luc Pattyn [Forum Guidelines] [My Articles]
I use ListBoxes for line-oriented text output (not TextBoxes), and PictureBoxes for pictures (not drawings).
modified on Friday, June 10, 2011 12:19 PM
|
|
|
|
|
It is my only thread i have settings file in common with my GUI and thread(i user Control.Invoke to reach to my Settings.xml ), there is no background worker. my thread is no timer, no serial port,
my thread just listen to network for any incomming clients(Listener.AcceptTcpClient()) and answer those clients according to what is on my sql database. and that's all, i am so Confused
|
|
|
|
|
Hi,
I still don't get the overall architecture of your app. If you want help, then please explain yourself.
This is what I got so far:
- it is a server app; AFAIK most servers create a thread for every incoming request, so each request can get handled at its own pace (the alternative of just queueing all requests and handling them one by one does not scale well).
- you use AcceptTcpClient() which is a blocking call; if you do this on the main thread, the GUI dies
until a client comes in??? otherwise, you need a separate thread that accepts clients and dispatches them.
suggestions:
- explain the architecture, using real names;
- show actual code, not just a skeleton; but not hundreds of lines, just the relevant pieces.
- when in doubt about threading use either someControl.InvokeRequired; whenever it returns true you need
to use (Begin)Invoke
- and/or when in doubt about threading, log the Thread.CurrentThread.ManagedThreadId so you can compare
it to the one of the GUI thread (by logging ManagedThreadId say inside a form load handler).
|
|
|
|
|
how can i get the contents of a variable that i declared as SqlDataReader in String format? like writing it to a file or whatever way that's easier. the code looks like below:
SqlConnection cnnConnection = new SqlConnection();
cnnConnection.ConnectionString = "Data Source=.;Initial Catalog=TestDB;User ID=sa;Password=123";
cnnConnection.Open();
SqlCommand myCommand = new SqlCommand();
myCommand.Connection = cnnConnection;
myCommand.CommandType = CommandType.Text;
myCommand.CommandText = "select cname from testtable";
SqlDataReader sdr = myCommand.ExecuteReader();
--- Thanks
|
|
|
|
|
They hide that information in something called documentation[^]
only two letters away from being an asset
|
|
|
|
|
Hi,
I was trying to automate MSExcel using C#. I face a problem when I was trying to open a workbook for the second time, throwing up a message
"xls is already open. Reopening will cause any changes you made to be discarded." inspite of releasing the Workbook Object. Any help to suppress the message would be greatly appreciated.
Thanks in advance.
Code snippet used.
m_oWorkBook = m_oWorkBooks.Open(strFileName, m_objOpt, false, m_objOpt, m_objOpt, m_objOpt, m_objOpt , m_objOpt, m_objOpt, true, m_objOpt, m_objOpt, m_objOpt, m_objOpt, m_objOpt); //open a workbook
.... //Some operation.
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
GC.WaitForPendingFinalizers();
Marshal.FinalReleaseComObject(m_oWorkBook); // release the workbook
Other Excel COM Objects which are acquired are also released in the proper sequence.
|
|
|
|
|
KarthikonIT wrote: GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
GC.WaitForPendingFinalizers();
Why ??
|
|
|
|