|
Well, one option is to use a memory mapped file to get shared access to the data. There is an article here about it:
DevGlobalCache – A way to Cache and Share data between processes[^]
That's C++ but you may be able to rework it to C# depending on how confident you feel about that sort of thing.
Alternatively, you could have one central "cache manager" that loads the cache into memory on system start-up, then the other processes link to it using named pipes or something to load the cache into their local memory when they initialise (or lazy-load the cache as they need it).
Or, you could load the cache once, then serialise it out to disk in an easy to read format that can be loaded back when needed. Depending on what is involved in loading the cache, reading a serialised stream in from local disk might be quicker than re-initialising the cache from the ground up each time.
The problem with these solutions is keeping the cache synchronised across all instances, but from what you say that doesn't sound like it's going to be a problem for you.
|
|
|
|
|
Hi, Im developing Tabcontrol in WPF with C#.In coding i entering text to Listbox(3rd tabitem),when i click any place in tabcontrol.But th text is not gwtting displayed.
But when i debug i got that,for every click in tabcontrol,the Count in listbox get increased to 1,2,...
Code:
namespace Tabcontrol
{
public partial class PresetTab : UserControl
{
public PresetTab()
{
InitializeComponent();
}
public void AddPresetmenu(string pMenu)
{
menubox.Items.Add(pMenu);
}
}
}
namespace Tabcontrol
{
public partial class ToolBar : UserControl
{
PresetTab tab = new PresetTab();
public ToolBar()
{
InitializeComponent();
}
public void Click(object sender, MouseButtonEventArgs e)
{
tab.AddPresetmenu(menu);
}
}
} Anu
|
|
|
|
|
Hi,
I am trying to develop an application in C# to build a chat client that authenticates a user with his gmail account.. As I searched online for any open source software that might help and i found this very promising :
Google Chat Desktop Application using Jabber.Net[^]
If I execute this from a stand alone computer, it works fine without any problems... However, if I execute this from a corporate environment where there are NAT and firewall being configured, i get this error :
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 74.125.155.125:5222
where 74.125.155.125 is that of google.
I am not sure what this means... It doesn't appear like a time out.. It looks like something in the corporate environment is blocking this communication... However, I am able to use Google Talk application in the same environment...
What could be the reason? And how could it be overcome? Could someone pls help?
Thanks,
Ram
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:45am.
|
|
|
|
|
Hi stancrm,
Thanks for your reply... I shall try this out and get back to you...
Thanks,
Ram
|
|
|
|
|
Hi stancrm,
Just an update on this... I tried to use wirebook to get the stats and I found this out :
The request is going out and reaching google... But the response is not coming back.. That seems to be the problem...
Any idea?
Thanks,
Ram
|
|
|
|
|
Since you said that you have a corporate firewall in the way, I would suspect that this is blocking the responses. If you have a legitimate business reason to access Google Talk, then I suggest you contact your IT department, who may allow such traffic through for you. Otherwise, you are out of luck, probably. You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
|
|
|
|
|
Hi OriginalGriff,
OriginalGriff wrote: If you have a legitimate business reason to access Google Talk, then I suggest you contact your IT department
I had mentioned in my first post that I am able to connect using Google Talk and initiate a chat... The problem is while trying to replicate that behavior in my application...
If firewall is blocking the response, I would like to have an idea on how Google Talk is able to establish a communication that my application could not...
Pls suggest...
Thanks,
Ram
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:45am.
|
|
|
|
|
No... I havent used it yet... I shall try that also...
Thanks,
Ram
|
|
|
|
|
hi,i have added some data to my listview.i want to add all the list view rows to a dataset or datatable using c#.please help me.give me the logic.
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:45am.
|
|
|
|
|
could u kindly send me the code in c#???
|
|
|
|
|
Hi. I have controls that are being loaded at run time. Initially when they are loaded they appear as they should be but when i minimize the windows form, and restore it, they add extra spaces between them. This curious behaviour is really threatening my sanity because i have gone through the source code (for the 100th time )and there appears to be no problem with it. Below is the source:
private void ShowQuestionsAndAnswers(ArrayList questions, ArrayList answers)
{
groupBox2.Enabled = true;
j = 0;
for (int i = 0; i < questions.Count; i++)
{
tbp.Invalidate();
j = i;
ArrayList ans = new ArrayList();
GroupBox gb = new GroupBox();
gb.Size = new Size(tbp.Width - 100, 150);
tbp.Controls.Add(gb);
TableLayoutPanel tbp2 = new TableLayoutPanel();
tbp2.ColumnCount = 1;
tbp2.AutoSize = true;
gb.Controls.Add(tbp2);
Label newLabel = new Label();
newLabel.Text = (i + 1).ToString() + ". " + questions[i].ToString();
newLabel.AutoSize = true;
newLabel.BringToFront();
newLabel.Size = new Size(1000, 100);
RadioButton rdb1 = new RadioButton();
rdb1.AutoSize = true;
tbp2.SetRow(rdb1, 1);
rdb1.Text = a[0].ToString();
rdb1.Click += new EventHandler(rdb_Click);
RadioButton rdb2 = new RadioButton();
rdb2.AutoSize = true;
tbp2.SetRow(rdb2, 2);
rdb2.Text = a[1].ToString(); ;
rdb2.Click += new EventHandler(rdb_Click);
RadioButton rdb3 = new RadioButton();
rdb3.AutoSize = true;
rdb3.Text = a[2].ToString(); ;
rdb3.Click += new EventHandler(rdb_Click);
RadioButton rdb4 = new RadioButton();
rdb4.AutoSize = true;
rdb4.Text = a[3].ToString();
rdb4.Click += new EventHandler(rdb_Click);
Control[] ctrl = { newLabel,rdb1,rdb2,rdb3,rdb4 };
tbp2.Controls.AddRange(ctrl);
a.RemoveRange(0, 5);
}
Button btnDone = new Button();
btnDone.Text = "Done";
btnDone.Click += new EventHandler(btnDone_Click);
tbp.Controls.Add(btnDone);
StartTimer();
}
What could be the reason for this and how can i solve it?Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
modified on Thursday, February 18, 2010 3:12 AM
|
|
|
|
|
Do you handle an Resize event? You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
|
|
|
|
|
Hi,
I am writing an application that can sense the surrounding temperature.
I am thinking to plot the different temperature readings through a dynamic graph(if this is the correct term), every few seconds or even 1 minute.
Like for eg, 3.47pm, temperature reading is 27 degrees, 3.48pm is 28 degrees. 3.49pm is 28.5 degrees and so on and so forth...
The graph will be able to display the temperature (perhaps on the y axis) while the time on the x-axis.
Could anyone give me advise on this? I tried searching on Google but mostly I found are those that are cos/sin graphs.
Thanks,
Daniel
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:46am.
|
|
|
|
|
Thanks for the tip, however, I am looking for something more real-time, how can I approach this?
|
|
|
|
|
Set up a timer, with the appropriate interval, and put a panel or similar on your form.
When the timer tick event fires, use Panel.Invalidate to force a re-draw.
Override the Panel.Paint event and draw your graph. You may wish to set DoubleBuffered to avoid flicker.You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
|
|
|
|
|
Hello all,
Does anybody know how can I add text to an elliptic line using GDI ?
Thanks,
Berlus
|
|
|
|
|
See here[^]
It's using Bezier, but you can change that bit quite easily.You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
I have one main thread, and many other background thread.
The main usage of those background thread is to query data (quite a number of queries from the web, that's why I make it threads: avoid the lagging of the user interface ).
When it comes to exporting the data in the main thread(the user interface), I need to wait until all the other thread finished.
in my code, I use:
while (QueryThread.threadCount != 0)
{
Thread.CurrentThread.Join(1000);
Console.WriteLine(QueryThread.threadCount);
}
if I comment the while loop out, the program run smoothly, but some of my exported data will have possibility of showing some "unwanted" material since some of the background threads hasn't finished their work.
however, the above while loop is infinite, the threadCount never change, which means during the "Join()" method, no background thread is being ran.
why the background threads are not ran and how can i solve this problem?
Thanks a lot!
|
|
|
|
|
Have you tried to call Join() on your separate working threads in your main thread instead?
For instance in your main thread
Thread t1 = new Thread(DoWork_1);
Thread t2 = new Thread(DoWork_2);
Thread t3 = new Thread(DoWork_3);
t1.Start();
t2.Start();
t3.Start();
t1.Join();
t2.Join();
t3.Join();
Console.WriteLine("All threads done");
|
|
|
|
|
|
You are using background threads to keep the UI responsive, which is good. But then you are blocking in this method. I suggest you disable exporting in your UI until you know all the data is ready.
You will still have to detect when your background threads have completed and the data is ready to be exported, which is a similar requirement to the code you posted. So you will still have to get the threads to signal they have completed. Setting an int counter to the number of threads and having them decrement it when they complete is as good a solution as any. You will also have to invoke a method on your UI thread when all the threads have completed, which would re-enable your export functionality.
You need to find out why QueryThread.threadCount is not being decremented. The code you posted will not stop background threads from running, so you have another problem somewhere.
One possibility is that you have not declared threadCount as volatile . Does the code work in a Debug build ( without optimizations ) ?
Nick----------------------------------
Be excellent to each other
|
|
|
|