|
Its getting closer, I have added them and can access them to a point using the following:
MonitorTab monitor = new MonitorTab();<br />
monitor.Name = "Monitor" + MonitorTabs.TabPages.Count.ToString();
But I still can't access that control except using a foreach looping through the controls on the tab, which doesn't allow me to access the timer. Any suggestions?
|
|
|
|
|
You can also make an hashtable, like [Tab] - [Monitor]:
private HashTable monitors = new HashTable();
MonitorTab GetMonitor(TabPage tab) {
return (MonitorTab) monitors(tab);
}
void AddTab() {
TabPage newMonitorTab = new TabPage(TabTitle);
MonitorTabs.TabPages.Add(newMonitorTab);
MonitorTab monitor = new MonitorTab();
newMonitorTab.Controls.Add(monitor);
monitors.Add(newMonitorTab, monitor);
}
MonitorTab selectedMonitor = GetMonitor(this.tabControl1.SelectedTab);
Pompiedompiedom...
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
That worked great! Thank you both! *sigh of relief*
|
|
|
|
|
Hi, can anyone help I need a string manipulation to do the same as Len(in VB) or strlen()in C as well as Mid$ in VB or strstr()in C. This is to allow me to pick off bits in a string to send them to the RS232
Doh!
-- modified at 15:17 Friday 9th December, 2005
|
|
|
|
|
|
I tried that it comes up with LEN which I can't get to work, or is it something like string.LEN, I am a little desperate!
Glenn
Doh!
|
|
|
|
|
What!? Where? No where in the linked page is there a LEN() or string.LEN
string myString = "Some text";
myString.Length
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
GlennP. wrote: I tried that it comes up with LEN which I can't get to work
What are you talking about? Where on the link I posted did it mention LEN? It did quite clearly mention Length and Substring which can be used in place of Len and Mid from VB. So what's the problem?
|
|
|
|
|
I am sorry I was using the MSDN that came with the version of .NET which is different from the from the online version, All I can say is a nights sleep is required at least once a week!! sorry!
Doh!
|
|
|
|
|
The one that can with Visual Studio .NET doesn't mention LEN either! Are you sure you were looking at the .NET version or the older VB6 version?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
If you use VC++ 2005, you can access the .NET libraries as well as use your favorite C and C++ stuff (like strstr or std::string).
|
|
|
|
|
I did, but "C# is a new language and will be supported longer" is it just me or our ******t clients said that to me I only do as they ask!!
Glenn
Doh!
|
|
|
|
|
Hi, I'm actually working on a school assignment and need some help. The assignment is a world simulation. On this world you can add animals and stuff. The application is already working remotely. Each pc acts as client and server. What I still need to do is to make sure that when a (server)pc (a world) is shut down or crashes, that one of the other pc's in the network becomes the server with the data.
Can someone point me in the right direction or does anybody know where I can find a sample of something similar?
Any help is appreciated.
Thanks in advance.
|
|
|
|
|
iits pretty simple. google for it. theres lots of examples
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
Thank you Ista for your reply. I've have already tried google. But I don't know exactly what to search for. I did find some simulation, but I didn't find anything that has to do with when a server shutdown/crashes and one of the other pc's in the network has to take it's place. Anybody know where I can find a sample or something?
Thanks in advance.
|
|
|
|
|
add a little pinging routine that checks to see if the server is alive, if not cycle through the next item in the array.
You just need a simple loop.
You will also need to open channels programmtically.
I would diagram the problem out and list the possible scenarios so you can come up with a possible solution.
But basically if you try and open a chennel and it doesn't work then the server is dead.
You could do this: Create a class that channels the requests through and picks the server to contact. It would be imitation of load balancing. Check out "design patterns" on google till you find one that meets your situation.
Nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
I have a dll that I've written that uses a class to store settings that is serialized to an xml file so it can be easily edited by the end user. This works just find with a simple C# tester program, the settings can be serialized and deserialized without any problems. However, I need to call this dll from a LabView program and there it will not work. I've narrowed the problem down specifically to the deserialization of this settings file which throws an invalid cast exception. Anybody have any ideas why the deserialization would work fine when the library is called from a C# program and not when its called from LabView?
|
|
|
|
|
Can you give us more information on what LabView is? If it's a program that you own, does it have a reference to the Library that contains the classes are serialized to the file?
Jared Parsons
jaredp@beanseed.org
http://spaces.msn.com/members/jaredp/
|
|
|
|
|
LabView[^] is a horrible torture device that National Instruments tries to pass off as a "programming language".
It's supposed to be able to act as a client for .NET classes but it's been giving me all kinds of trouble. The actual class being deserialized though is called from another .NET dll (that LabView loads itself) that loads the assembly that contains the class to be deserialized. If I skip the deserialization it works fine (sort of, it actually has a habit of hanging when I try and quit!)
|
|
|
|
|
Hi
I had a question abt the Inconsistent Read concurency issue with my application's data access that I am currently developing. Here is my problem. I am using custom business objects that represent my database entities. For example, in one of the web pages displays a list of users in a datagrid bindng it to customcollection that holds user objects (instance of my user class). I am using Enteprise Library to do my dataccess. my DAL would read the data from the database (makes a call to the store procedure) and pass the custom collection of user objects to the UI. When the user clicks on any row of the displayed list, it takes himt o another page that displays further details of that particular user and he may update them. Do I need to use any lock options while reading the data from the database? I mean optimistic concurrency control?
Any suggestions would be greatly appreciated...Please help.
Thanks
|
|
|
|
|
I didn't think that this question was appropriate for the ASP.NET forum but I will mention it in this question.
I currently have an ASP.NET page that receives an XML stream which I write to disk.
StreamReader reader = new StreamReader(Request.InputStream);
string xmlData = reader.ReadToEnd();
...
StreamWriter writer = new StreamWriter( "Somefile.xnl, false);
writer.Write( xmlData );
writer.Flush();
writer.Close();
I would like to have this functionality using a Web service instead of an ASP page.
It is possible to use a web service to receive posts in this fashion?
Any pointers appreciated
|
|
|
|
|
yes. send a stream to it and save it
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
Would you care to elaborate a little.
I am very new to web services. My team lead is wanting me to do this without a IIS server even running.
What do you mean by send a steam to it? Then how do you save it, how does the webservice get hold of the stream.
Note: I have no control of how the stream is sent to me. I give them a url to post to and they send me an stream formated as xml.
Thanks
|
|
|
|
|
Okay. define the web services as a memory stream
like maybe
public void SendMyData( MemoryStream ms )
{
// Write the text to the file here
}
So the user will call your web service and send them stream to you. And you can what you want with it.
Your PC will have the IIS on it so any PC that has IIS can hold the web service. Not having a web server to deploy is just crazy!
But the programs will simply locate your WSDL file and they will see they need to send a Stream to it.
You don't have to use a memory stream, it's just one I use a lot. Play with it.
When you create the web service it creates the WSDL. So Create another app and click Add Web References and find the wsdl then call it. Its easy
If you need help I will up for for another 3 hours
Nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
I follow what you are saying.
I realize that not having a web server to deploy it crazy, but I have been asked to look into this method.
The problem that we are trying to get around it the limitation of IIS 5 running on XP, which is 10 conncurrent connections. Of course this could be solved by switching to 2003 server and IIS 6 but that is not the exercise.
Given that explanation is there a way to do what my team lead wants, even if it's insane, I need to go back to him with some answers.
Again in a nut shell here is what he wants.
1) create a web service independent of a IIS server.
2) have this web service receive the data sent my our client.
It seems to this that this would require socket programming as I don't see how a web service could receive streams without a server.
Thanks
|
|
|
|