|
sorry for the double post..
th last thread was askin for you all point of view if i should use a thread for my read function.
and yes i was hoping to up date a textbox in the form directly from the thread..
is it possible?
|
|
|
|
|
You need a referece to the form to update an element in it. You can't access the form from a static method without a specific reference to the form.
---
b { font-weight: normal; }
|
|
|
|
|
I have a button that when clicked will draw a line on a Form.
How do I pass to the Paint handler that the button was clicked
to DrawLine, since I should do all my drawing inside the Paint handler?
i.e...
//
btn_OK_Click
{
///
g.DrawLine(.....
}
//
private void On_Paint
{
//btn_OK_Click ??
}
|
|
|
|
|
You can use Invalidate method in the button click event handler which will repaint the window; so in the OnPaint you can put the code for drawing the line.
Regards,
Ashok Dhamija
_____________________________
Padam Technologies
|
|
|
|
|
Hi..
i doing a program to communcate with a plc.. on serial port.
i got it ro sent but i tink there a problem with the recieving.
some time i got it some time i dont..but i check with the hypertermianl. and the command was find..
so i tink there maybe a pro in the send part.. i sent() then read(),
should i start a thread on readin first?
if so some help on threading cos i have no knowledge on threading.
thanks
|
|
|
|
|
Hi,
Anyone know why this problem may occur and how it can be fixed?
on a "Response.Redirect" the screen goes blank.
It works perfectly fine on my local machine, but gives a blank screen on the server (running Windows Server 2003).
|
|
|
|
|
Is it really the screen that goes blank, or do you mean that the browser window goes blank?
What url are you using in the Response.Redirect call?
---
b { font-weight: normal; }
|
|
|
|
|
Some time there is threadabort exception occurs, In this case you need to catch it.. Try looking into it and then see !!
Regards,
Jaiprakash M Bankolli
|
|
|
|
|
I succeeded to build a peer session between server and the client but i want to make voice session iam using directx directplay namespace of dx9 .
But i have one problem which make me too mad even i searched it in msdn and it is really abusing me
it is the constructor of that class server inside the voice component in directplay namespace
<br />
Microsoft.Directx.Directplay.Voice.Server myserver = new Microsoft.Directx.DirectPlay.Voice.Server(object dplay);<br />
What is the dplay object it is written in the msdn is that it initializes new instance of the object but what object i need someone to help me in this topic please.
I even tried two ways .
First I declared an object for this object myobject;
And i passed it in the parameter but it also didn't work.
I passed the peer session as an object to it but it gave me an exception.
Please try to help me.
I only want somebody to show me simple code for successfully initialize that server constructor without any exceptions.
Or show me simple code for initializing successful voice sessions between two clients ?
Miss With The Best And Die Like The Rest
|
|
|
|
|
Look at tutorial 8 in the samples that come with DX9.
private void InitDirectPlay()
{
// Release any exising resources
if (m_Peer != null)
m_Peer.Dispose();
// Create a new DirectPlay Peer object
m_Peer = new Peer();
// Add handlers for DirectPlay events
m_Peer.FindHostResponse += new FindHostResponseEventHandler(FindHostResponseHandler);
m_Peer.Receive += new ReceiveEventHandler(ReceiveHandler);
m_Peer.HostMigrated += new HostMigratedEventHandler(HostMigratedHandler);
m_Peer.SessionTerminated += new SessionTerminatedEventHandler(SessionTerminatedHandler);
m_Connection = ConnectionType.Disconnected;
}
This source code initialises and sets up a peer object, which seems to hold a bunch of callbacks. This is the object you need to pass into the Voice constructor. I'd agree, there's no docs I could find on this either, but I found this in the samples pretty quickly.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
My friend i already done this code and i passed mypeer object to the constructor of the voice server class but if gives me an exception
Miss With The Best And Die Like The Rest
|
|
|
|
|
Then you should have said so. This is what's required, if you get an exception, then you're doing it wrong. Run the code in the sample, and then work through until you figure out what step the sample takes which you are missing.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
1. How to retrieve the needed row from DataGrid?
2. How to change wide of each column?
thanks
|
|
|
|
|
You can get selected row index....
To change wide of colume, you can create column styles.
hope this helps you...
- ashish
|
|
|
|
|
for selecting a particular row from datagrid use this coe
private DataGridCell myCell=Datagrid1.currentcell;
TextBox1.text=this.Datagrid1[myCell.Rownumber,0].ToString();
0=coulmn number
this might be helpfull for u
Naveed Kamboh
-- modified at 19:41 Wednesday 21st September, 2005
|
|
|
|
|
I made a notify window application, works well, but when I do a shutdown my workstation at the end of the day, the application will not shutdown, leaving windows XP SP 2 hanging unable to shutdown. Have to manually shutdown the app, then windows will shutdown, without any problems. Any ideas on how to fix this problem?
|
|
|
|
|
You have to release resources of the application on closing it put an event for closing of the main form of your application and put this code inside it
<br />
system.Enviroment.Exit(System.Environment.ExitCode);<br />
to release all resources of your application on closing or it will still working in a hidden mode in your processes of your Os.
Miss With The Best And Die Like The Rest
|
|
|
|
|
|
Hello everyone!
I'm really in need of some professional help here. I'v created at transparent richtextbox, using this article:http://www.codeproject.com/cs/miscctrl/TransparentTextBox.asp?df=100&forumid=128070&exp=0&select=977976
As some of the users point out, the box does funny things when you scroll. I then overrided the OnVScroll, and this almos solved the problem. If you use the two up and down buttons in the scrollbar, or use the mouse to scroll the box updates with no problems. BUT if you use the bar it self, the scrollbar, then noting happens,and the text is screwed.
I really hope someone can help me with this!!!!
Thanks in advance.
|
|
|
|
|
I am working with Sockets – I find this interesting, and I would call it a bug. It seems odd that the bytes that comes from GetAddressBytes is not valid for creating a new address given the prototype for it is the same. (A System.ArgumentException is thrown) let me know if you find this odd, a bug or if I am just not understanding how to use this interface correctly.
using System;
using System.Net;
using System.Net.Sockets;
using System.Windows.Forms;
using ThreadingEx;
namespace foo
{
[STAThread]
static void Main(string[] args)
{
IPHostEntry Host;
IPAddress Address;
IPAddress Address2;
Host = Dns.Resolve(“AnyAddressThatResolves.com”);
Address = Host.AddressList[0];
/*
** This will cause an error, the prototype is
** public IPAddress(byte[] address);
** and the GetAddressBytes is
** public byte[] GetAddressBytes();
*/
Address2 = new IPAddress(Address.GetAddressBytes());
}
}
|
|
|
|
|
|
I'm trying to get my head around objects and am asking for thoughts on this
idea.
If for example I were to implement a Person Object, there may be differnt
Person objects representing people of different cultures.
All Person objects have similar characteristics, ie Height, Weight, Age ect
but I imagine that there could be a method ie SayHello which Person objects
of different cultures would implement differently.
Now what i'm trying to figure out is whether the Person Class should be
abstract to cope with different cultures or whether I should create an
interface or both.
Thoughts and comments appreciated.
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
LearnVisualStudio.Net
|
|
|
|
|
Although you could implement it with interfaces, a simple virtual method for SayHello, or other methods, would be simplier.
|
|
|
|
|
Hello
I don't think there are any requirements for using interface in your case.
You can create your base Person class, with a virtual SayHello method. You can provide it with default realization (may the person can greet you on some kind of default language of human being saying "Mmmm" or with some other action). Then, any other class, which will inherit your base class, can override the method. Or you can make the method abstract to make it obligate to provide realization of the method.
With best regards,
Andrew
|
|
|
|
|
Why make the SayHello method virtual? Could you noy just Override the method in the derrived class?
I understand that making it abstract forces the derrived class to implement the method in its own way but again, could this not also be achieved by Overriding the inherited method?
Is there a benefit or forefeit to either approach?
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
LearnVisualStudio.Net
|
|
|
|