|
I'm doing some graphics work, using Bitmap objects, and a timer that calls the form's Refresh() method. This works, but it updates the entire form, and it flickers. I know it's possible to avoid this, but I'm not sure where to start. Any clues?
Thanks in advance,
Justin Clayden
===================================
| Justin James Clayden \
| Director, Cool Fusion Multimedia \
| mailto:justy@coolfusion.com.au \
| http://www.coolfusion.com.au \
| http://www.arch.usyd.edu.au/~jcla8108 \
=========================================
|
|
|
|
|
Use double bufferring.
Thanks
Alam
Live Life King Size
|
|
|
|
|
iam developing server \client applications and i ask if this code can work on the real internet network or not
here is the code for my file transmission server listening thread.
<br />
Socket ServSock = new Socket(AddressFamily.Internetwork,Sokettype.Stream,ProtocolType.Tcp);<br />
IpHostEntry iphost = Dns.Resolve(Dns.GetHostName());<br />
IpAddress thisip = iphost.AddressList[0];<br />
IpEndPoint myendpoint = New IpEndPoint(thisip,(Int32)7291));<br />
ServSock.Bind(myendpoint);<br />
ServSock.Listen(-1);<br />
This Code will get the local ip address of the computer it is running on and connected to the internet and listens for any Clients' Socket Requests and with small other portions of codes it will accepts the client connection in this part there is the main server that will be running on any webserver like any dedicated webserver so the above code will be run when one user A wants to send a file to the other user B the main server on the webserver will send to B the ip address of the networkstream of A so B will begin to initialize an ipendpoint for this client A on B's Client Application as follows.
<br />
Socket clientSock = new Socket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp);<br />
IpHostEntry remoteiphost = Dns.Resolve("A's Ipaddress that sent by the main server");<br />
IpAddress remoteA = remoteiphost.AddressList[0];<br />
IpEndPoint Aendpoint = new IpEndPoint(remoteA,(Int32)7291);<br />
clientSock.Connect(Aendpoint);<br />
if(clientSock.Connected)<br />
{<br />
}<br />
The Question is:
----------------
Can the server and client be connected to each other even if these users using dialup connection or both using Dsl or one differs than the other in the type of connection .....? Cause i tested it on my local pc and it works and i tested it over real network in too many computers connected together in internal network as in cybers but can be connected also over the internet ?
Please Help me .
Miss With The Best And Die Like The Rest
|
|
|
|
|
Can somebody tell me what is the benefit of using events?
Are there any performance gains? What is the point?
|
|
|
|
|
In what regard ?
There are no performance gains, there is a loss, in terms of a lookup being required to find the method to call.
The reasons are:
1/ Events in general are the model that make software like Windows possible. An event is the only way to have a button, for example, and run some code if it is clicked.
2/ If you mean delegates in general, they allow different classes to communicate, and provide things like a callback mechanism from one class to another, so for example, in my C# paint program, an instance of the tool class, which is a specific drawing tool, can fire an event to let the main code know that a drawing event has occured, and to send the details so it can be added to the event list ( the code uses a list of drawing actions to facilitate easy undo/redo ).
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
hi Nick. You're a C# MVP ? Will I see you in Seattle ?
This guy probably didn't read your link, he asked another question of me today, then got really rude because I gave an MSDN link that didn't include full cut and paste code for what he was trying to do.....
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Does anyone know of a control or method for creating an options dialog like that used by visual studio? Basically there's a treeview on the left side of the dialog and depending on what you select it displays the panel that's associated to that node. I tried to implement this with a tabcontrol in vs2005 but there's no way to hide the tabs at the top. Can I just override that pain event?
Thanks,
Rob Tomson
--
There are 10 kinds of people. Those who understand binary and those who don't.
|
|
|
|
|
Use a big panel with user controls inside, and just show the user control for the selected tree item.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
If you want to integrate with Visual Studio, you should check out the Visual Studio Extensibility Center/[^], there is all kinds of documentation for writing add-in's for Visual Studio there.
|
|
|
|
|
I have singleton server object that is published:
RemotingServices.Marshal(myObject, "myObj.rem");
And that object is connected to by clients:
IServerObj = RemotingServices.Connect("tcp://.../myObj.rem");
My question is, should I connect to IServerObj one time only and keep it alive until the client closes? Or is it better to connect to the IServerObj each time the client wants to communicate with it?
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Homosexuality in Christianity
Judah Himango
|
|
|
|
|
I see it going both ways..
Leaving the connection open with clients that use it once in the morning and don't touch it again may not be the best choice.
Making connections as neccessary could result in a number of hits on the server depening on your clients usage.
I would probably look at keeping the connection open for a timed period then terminate it on expiration.
|
|
|
|
|
The usage is typically many messages get sent, then the user logs out. There's only brief periods when the connection is idle. However, using my "keep it always opened" technique, I've run into problems over WAN/internet where the connection gets disconnected for no apparent reason.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Homosexuality in Christianity
Judah Himango
|
|
|
|
|
Hello,
I was wondering, how do you people update you UI such as controls, menu items and tool bar buttons?
I'd like to have something like ON_UPDATE_UI in MFC, but there's nothing in .NET. Currently I've used a timer every 1/4 of a second and it seems to work ok, without using much CPU time.
I know I could use MenuPopup events (it won't work since I have toolbar buttons for menu items), SelectedIndexChanged events and so on, but I would like a general approach.
Any ideas?
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
To simply refresh the form (to redraw it's self) use: this.invalidate;
Please correct me if i'm wrong on this.
|
|
|
|
|
It works as you say, but is not what I'm looking for.
I'm asking about ideas to implement an update mechanism for user interface elements (menu items, toolbar buttons, controls).
For example, you only want the Delete button enabled if an item is selected in the list view control. You could use the SelectedIndexChanged event, but that would be particular for that list view control. What I want is a generalized mechanism for doing this.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
|
From reading that page, it seems a little too complicated for a general solution for a small app, isn't it?
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Luis Alonso Ramos wrote:
From reading that page, it seems a little too complicated for a general solution for a small app, isn't it?
True, it all depends on how small the app really is.
|
|
|
|
|
Does the Application.Idle event serve your purpose?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Okay, so I'm just starting to work with AJAX, and I've run into one small problem. I have a .Net dropdownlist control with an "onChange" javascript event and an "OnSelectedIndexChanged" .Net event. When the selection is changed, I am populating another dropdownlist. Everything with AJAX seems to be working. The problem is, the dropdownlist is defaulted to one value. If I select a new value, everything works. But, if I then go back and select the original value, it does not work. The reason is that because I'm not doing an actual "PostBack", the selected value never really changes. So, when I go back to select the original value, .Net does not fire the "OnSelectedIndexChanged" event. Does this make sense? If so, does anybody know how I can fix this? Or something I could try? I've been racking my brain for hours to no avail. I can post code, but I'm pretty sure that won't make much of a difference. Thanks for any help.
Ex.
DEFAULT: LISTBOX1: A LISTBOX2: A, B, C, D
CHANGE : LISTBOX1: B LISTBOX2: E, F, G, H
CHANGE : LISTBOX1: A LISTBOX2: E, F, G, H (because .Net event didn't fire)
|
|
|
|
|
You might try posting this in the ASP.NET[^] forum.
|
|
|
|
|
Hello,
Is there a way to display a full row from a dataset, using some command,
or do I have to use sort of this statement where I have to list every column I want to be displayed.
Debug.WriteLine ("Row: "+myRows[0]["ProjectID"]+","+myRows[0]["ProjectTypeID"]+","+myRows[0]["EmployeeID"]+","+myRows[0]["VersionNumber"]);
Thank you
|
|
|
|
|
You could use WriteRow
<code>void WriteRow(DataRow row)
{
string str = "Row: ";
for(int i = 0; i < row.Table.Columns.Count; i++)
str += row[i].ToString();
Debug.WriteLine(str);
} I haven't tested this code, but it should work OK. I know a StringBuilder would be more efficent, but that's left as an excerise for the reader. (You could also output column names this way.)
Good luck!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Hi friends,
I'm trying to detect locking of my workstation. so far I've worked a lot on it and the result of it is as following...
protected override void WndProc(ref System.Windows.Forms.Message m)<br />
{<br />
<br />
<br />
switch(m.Msg) <br />
{<br />
case WM_WTSSESSION_CHANGE:<br />
MessageBox.Show("Entered Session Change");<br />
switch((int)m.WParam)<br />
{<br />
case WTS_CONSOLE_CONNECT:<br />
MessageBox.Show("WTS_CONSOLE_CONNECT","WM_WTSSESSION_CHANGE");<br />
break;<br />
case WTS_CONSOLE_DISCONNECT:<br />
MessageBox.Show("WTS_CONSOLE_DISCONNECT","WM_WTSSESSION_CHANGE");<br />
break;<br />
case WTS_SESSION_LOCK:<br />
MessageBox.Show("WTS_SESSION_LOCK","WM_WTSSESSION_CHANGE");<br />
break;<br />
case WTS_SESSION_UNLOCK:<br />
MessageBox.Show("WTS_SESSION_UNLOCK","WM_WTSSESSION_CHANGE"); <br />
break;<br />
default:<br />
break;<br />
}<br />
break;<br />
<br />
default:<br />
break;<br />
}<br />
base.WndProc(ref m);<br />
}
The Messages like WTS_SESSION_LOCK and etc are also defined/declared in the application, as their values are found in windows.h;
Friends, my problem is that my application is running but it is neither responding to the code written above neither is generates any errors.
Please help me solve this problem. I want my system to respond to the above written code. Do I need to change it or any suggestions????? Please reply As Soon As Possible.
Thank u very much all in advance.
|
|
|
|
|