|
sorry to say u this method has no effect on the shutdown procedure of windows
|
|
|
|
|
Thought you were talking about app window
|
|
|
|
|
I'm curious, what is the reason for uninstalling your app when closing down. Seems a little drastic to me.
|
|
|
|
|
im not uninstalling the same application that im running im uninstalling any setup1 if previosly installed by me by mistake.
|
|
|
|
|
remoting dll >>>>
using System;
using System.Collections;
using System.Linq;
using System.Text;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Http;
namespace Remoting
{
public class ChatServer : MarshalByRefObject
{
ArrayList client = new ArrayList();
public void AddClient(string s)
{
client.Add(s);
}
public ArrayList AllClient()
{
return client;
}
}
}
Server code >>>>>>>>
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Http;
using Remoting;
namespace Server
{
public partial class Form1 : Form
{
ChatServer server;
public Form1()
{
InitializeComponent();
HttpChannel ch = new HttpChannel(8080);
ChannelServices.RegisterChannel(ch, false);
RemotingConfiguration.RegisterWellKnownServiceType(typeof(ChatServer), "CS", WellKnownObjectMode.Singleton);
}
private void ShowClients_Click(object sender, EventArgs e)
{
server = new ChatServer();
ArrayList cn =server.AllClient();
foreach (string c in cn)
{
listBox1.Items.Add(c);
}
}
}
}
client code >>>>>
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Http;
using Remoting;
namespace Client
{
public partial class Form1 : Form
{
ChatServer client;
public Form1()
{
InitializeComponent();
HttpChannel ch = new HttpChannel();
ChannelServices.RegisterChannel(ch, false);
RemotingConfiguration.RegisterWellKnownClientType(typeof(ChatServer), "http://localhost:8080/CS");
client = new ChatServer();
client.AddClient("AAA");
}
}
}
>>>>>>>>> when i click on showclient its not showing ........ what is the problem.
Thanks in Advance
|
|
|
|
|
Have you stepped through the code ? Why on earth are you using the ArrayList class ? It's obsolete.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
i am using arraylist to store all the clients name. i know its obsolete. well i can change it not a problem....
but what is the main problem why i am not getting the connected client when i am clicking on button showclient_click
help me
|
|
|
|
|
Well, I don't know. I am just wondering if you can explain what you've done to help yourself, using the debugger,etc. If you can tell us what line of code isn't doing what you expect, it would help us to narrow it down, without having actually build your code and run a client/server to see what happens.
Someone who has done more of this sort of work than me may come along and just answer it, but in the meantime, I think it's valuable to explore the things you should have mentioned in your original post, like what happens when you run it in the debugger.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
i have run debugger more then 5 times , but still not able to trace where is the problem....... its not showing any error....
but i am not getting the out put........
|
|
|
|
|
Sir these what i have done
1. i made a dll remoting in which i had 2 methods AddClient and ALLClient
2. i made a server add reference of remoting.dll file and here i am calling the method allclient to view the clients connected to the server
3. i made a client add reference of remoting.dll file and here i am calling the method addclient.
>>> anything wrong ?
|
|
|
|
|
What makes you think that adding to the list in one program, will make it appear in the other one ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
sorry sir.
i am just trying this way. when a client starts the applicationand connects the server i am calling a method Addclient(Sys.Env.MachineName) . and then on the server i want the name of the clients connected to the server..............
what i have done was wrong? sorry
help me out
|
|
|
|
|
You have two instances of the same class type. They are on different machines. They are not the same instance, nor can they be. Therefore, passing the value to one, does not pass it to the other. At least, that's how it looks to me.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
sir then how to do that.
cann't i call a method from the server and used it in the client ?
|
|
|
|
|
I am writing a DGV which uses the MultiSelect ComboBox code (available from here: http://www.codeguru.com/csharp/csharp/cs_controls/treeview/article.php/c15373/)
I hosted the Control following this MSDN tutorial :
http://msdn.microsoft.com/en-us/library/7tas5c80.aspx
What i've done is this:
- Editng EXTCombo and MultiSelect4Combo Constructor
public EXTCombo()
{
_multiselectList=new MultiSelect4Combo();
this.AddControl(_multiselectList);
this.LoadChildControl);
}
public MultiSelect4Combo()
{
InitializeComponent();
SelectionMode =SelectionMode.MultiExtended;
this.Items.Add("1");
this.Items.Add("2");
}
- Then make EXTCombo implements IDataGridViewEditingControl interface
- Through the EditingControlShowing event, get a reference to the editing control
OnEditingControlSHowing(..)
{
if (dataGridView1.CurrentCell.ColumnIndex==0)
EXTCombo _combo=e.Control as ComboBox;
if (_combo!=null)
{
_combo.SelectedIndexChanged +=OnSelectedIndexChanged;
}
}
OnSelectedIndexChanged(..)
{
string _slectedItems=(string)dataGridView1.CurrentCell.EditedFormatedValue;
dataGridView1.CurrentRow.Cell[0].Value=_selectedItems;
}
The problems are:
- After finish selecting in combobox and click another cell, the new value is not visible (in newly edited cell).
- All other cell (in same column) have the same value as the newly edited cell.
- OnSelectedIndexChanged is not Called at all
Can someone tell me how to fix this? thanks
|
|
|
|
|
hi
I have a DropDownList and MediaPlayer Control on my Form , I need to select a Scenario from DDL and need to Play the video.
The Scenario will be like this .
Scenario 1:
• Load the archive
• Play for 5 minutes
• Pause for 1 minute
• Play for 10 minutes
• Pause for 1 minute
• Play for 10 minutes
• Stop for 1 minute
• Play for 10 minutes
when ever i select the item from DDL Automatically all the above should play simultaneously .
If any one know how to do this Please let me know....
|
|
|
|
|
Seems pretty trivial to me. What have you tried ? Where are you stuck ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Murthuja wrote: when ever i select the item from DDL Automatically all the above should play simultaneously .
So it is like when scenario 1 is selected, all the commands under that scenario has to be executed, right? Commands will be different for each scenario. If yes, What have you tried so far? Which place you are stuck?
It sounds like a homework question to me.
|
|
|
|
|
N a v a n e e t h wrote: It sounds like a homework question to me.
Only if homework is getting dumber and dumber. This task is both trivial, and teaches nothing about programming. I say it's a 'I bid on rentacoder and don't know what to do' question.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Christian Graus wrote: I bid on rentacoder and don't know what to do
Nice category for the question.
|
|
|
|
|
The other way to tell is, they ask a question that is poorly put together and shows no thought, then never reply.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hello,
I am working on booking project and I have faced a problem with monthCalendar. What i need is to have a cutom method in monthCalendar so I can set background color for specified date. I tried to read about custom controls but I couldn't find much how to customize the calendar. thank you in advance
|
|
|
|
|
You won't need any custom control. You can use DayRender Event of the Calendar Control. Here you can set the background color of any date via
e.Cell.BackColor or e.Cell.Attributes.Add("backgroundcolor","red");
Infact you can add here some controls also via e.Cell.Controls.Add() method.
|
|
|
|
|
Hi
i've created a sample application with these characteristics :
1. I have 2 tables (Customers & Orders) in sql server database, Customers is master table and Orders is child table.
2. I have 3 forms in my app,
a. MainForm which display all customers
b. FrmCustomer which use to add new customer or edit current customer, it also display all orders of current customer.
c. FrmOrder which use to add new order or edit current order.
i want give ability to end-user to add new customer and his orders at the same time and click Ok, then my objectContext save all changes to back-end database. for example when i add new customer, FrmCustomer display me to enter new customer info, also i add some orders to his orders list, when i click OK in FrmCustomer, it should save customer and all orders Hierarchically, but it only save customer to database and not orders! can anybody help me to solve this problem ?
here is my code in MainForm to add new customer :
Customer newCust = (Customer)this.bindingSource1.AddNew();
FrmCustomer frm = new FrmCustomer(newCust,this.db);
if (frm.ShowDialog() == DialogResult.OK)
{
this.bindingSource1.Add(newCust);
db.SaveChanges(true);
}
else
{
this.bindingSource1.CancelEdit();
}
and here is my code in FrmCustomer to add new order :
Order newOrd = (Order)this.bindingSource1.AddNew();
FrmOrder frm = new FrmOrder(newOrd, this._objContext);
if (frm.ShowDialog() == DialogResult.OK)
{
this.bindingSource1.EndEdit();
}
else
{
this.bindingSource1.CancelEdit();
}
Note : db object is my global objectContext to pass to my form's constructor.
thanks in advance.
|
|
|
|
|
Check if the orders are saved to the database with no customer number.
You need to pass the new customer number to the orders object after the customer is created.
I do all this manually, call the submit method on the object (customer) in the savebutton method, get the ID returned via the object. I would also wrap the entire thing in a transaction in case it breaks, not sure you can do that using the bindingsource methods.
|
|
|
|