|
Hello all,
I have the following problem. I have 2 applications in c#, Application1 send some information to Application2 using a TCP connection. I have done everything
* On my server side
ChannelServices.RegisterChannel(...);
RemotingConfiguration.RegisterWellKnownServiceType(typeof(someRemoteObject), "someName", WellKnownObjectMode.Singleton);
* On my client side
ChannelServices.RegisterChannel(...);
sO = (someObject)Activator.GetObject(typeof(someRemoteObject), "...");
sO.callSomeMethodonServer();
The communication works, and I can retrieve the information from Application1 in Application2. The problem comes when I start sending the information from Application1 several times, after sending and receiving the messages "xxx" times the following starts to happen
1. Application1 sends the message
2. Application2 doesn't receive the message
3. Application1 freezes
4. Application2 starts consuming half of my cpu, and sometimes even more!!!
Any clues?? I'd really appreciate it
Regards, David
P.S If it helps I'm using .NET 1.1, VS2003, and windowsXP SP2
|
|
|
|
|
Hi,
Can u help me with displaying form's default context menu (Restore, Move, Size, Minimize, Maximize, Close items) programaticly ? I've custom non-client area and somehow that menu is not appearing when rightclicked on it. thanx
|
|
|
|
|
I want to access a variable and get its value.This variable was created in old form which is called. And now I'm being a new form. Pleased show me!
Thank you!
|
|
|
|
|
dont create the variable in the form load event.
create a separate class in the namespace of the old form
once you have done that, u can use the variable using the classname and the dot operator.
as classname.variable name
like, mySeparateClass.globalVariable1
Keshav Kamat
India
|
|
|
|
|
One metod is to create a new metod to show the new form.
public void myshow(object param)
{
this.Show();
this.param=param;
}
|
|
|
|
|
you can access that variable in any form, using the class name
Keshav Kamat
India
|
|
|
|
|
Keshav V. Kamat wrote: you can access that variable in any form, using the class name
No. You can't. He described an instance field. Not a static field.
|
|
|
|
|
Overload default constructor of the new form and pass the old form object to this constructor. Use that object to access the value
|
|
|
|
|
Can you can show me more clearly? May be give me some code? I'm a beginner. Thank you very much!
|
|
|
|
|
namespace Sample
{
public partial class Form1 : Form
{
}
// create a separate class here
public class mySeparateClass
{
public static int globalVariable=new int();
}
}
Once you have done that, u can access the variable globalVariable, anywhere in all the forms of the project using the classname as follows.
mySeparateClass.globalVariable
try it.;)
Keshav Kamat
India
|
|
|
|
|
Global variables are generally an indication of a poor design. If you feel compelled to use a global variable your first thoughts should be: Is there a better way to do this? If not, then fine, use the global variable. But they should not be your first option.
|
|
|
|
|
|
Please show me how to creat a variable that can use in all form in my project.I'm learning C#.NET 2005.
|
|
|
|
|
create a separate class like below
public class mySeparateClass
{
public static int globalVariable1 = new int();
}
then you can use the variable globalVariable1 as mySeparateClass.globalVariable.
check it out.
i hope this works.
Keshav Kamat
India
|
|
|
|
|
Declare a variable as static
public static int myvar=1;
|
|
|
|
|
Hi
We create application which was used webdav method
using this we fetch mails from exchange server for a particular mail id (like xxx@uuu.com)
We fetch Inbox Mails and Sent Items folder mails and insert into two tables (sql server)
My problem is, I want relate to Inbox Mail and Sent Item Mail
If One mail is come from in my inbox
say like "New Mail.EML"
when i reply to "New Mail.EML"
it stored in sent items folder as "RE:New Mail.EML"
i want how to find relationsship between NewMail and RE:NewMail
Which Property in webdav method , to determine this relationship
Expecting Earlier answer
By
Arun
|
|
|
|
|
I have create one xml from one dataTable.
DataTable dt=new DataTabel();
.................
oleDbCommand1.CommandText = "SELECT * From ss";
adapt = new OleDbDataAdapter(oleDbCommand1);
...............
adapt.Fill(dt, "one");
dt.WriteXml("dei.xml");
the xml is like this:
<one>
<unu> string <\unu>
<\one>
<one>
<unu> double <\unu>
<\one>
<one>
<unu> float <\unu>
<\one>
i need to create :
<one>
<unu> string <\unu>
<unu> double <\unu>
<unu> float <\unu>
<\one>
-- modified at 4:54 Wednesday 14th March, 2007
|
|
|
|
|
Add this datatable to a dataset names one. Then use dataste writexml method..
I am not sure..It's a wild guess
|
|
|
|
|
no works that
|
|
|
|
|
I'm a beginner. I opened a new form and want to close old form. But I don't know how to close old form. Help me!
Thank you everybody.
|
|
|
|
|
|
You can hide the old form
Form2 form=new Form2();
this.Hide();
form.Show();
... but it is a problem if you close the form2 the program run in background
|
|
|
|
|
ya so when form2 is closed,
please use a similar piece to show any other form, from which u can proceed.
Keshav Kamat
India
|
|
|
|
|
if you want to close the application you need to use
Application.Exit();
|
|
|
|
|
Don't close the form where static void main is there. Entire application will be closed !!!!!!!!!!
|
|
|
|