|
It's not blank. It's a bug in CP.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hello experts,
I've always used the Control.Invoke() method when invokation was required.
However, in my current project I need to use the Control.BeginInvoke() method instead.
So here are a few questions...
What does it mean when MSDN documents say:
Executes a delegate asynchronously on the thread that the control's underlying handle was created on. I always thought that asynchronous execution means executing an operation on a new thread. Is that true?
If so, how could an operation be executed "asynchronously on the thread that the control's underlying handle was created on"?
I think my understanding of the term "asynchronous execution" is wrong...
And one more... Should I use Control.EndInvoke() even if I've no need for the returned value?
Thanks in advance,
Shy.
|
|
|
|
|
shyagam wrote: I always thought that asynchronous execution means executing an operation on a new thread. Is that true?
If so, how could an operation be executed "asynchronously on the thread that the control's underlying handle was created on"?
No, that's not true. Asynchronous execution only means that the method starting the execution doesn't wait for the execution to end. If the execution is done on the same computer, a different thread has to be used for the execution, but it doesn't have to be a newly created thread.
shyagam wrote: And one more... Should I use Control.EndInvoke() even if I've no need for the returned value?
No. The EndInvoke only waits for the execution to finish and gets the return value from it.
---
single minded; short sighted; long gone;
|
|
|
|
|
I see...
Thanks a lot!
|
|
|
|
|
shyagam wrote: Executes a delegate asynchronously on the thread that the control's underlying handle was created on.
Just means that if you call BeginInvoke on a different thread than the one that the control is running on, the control will marshal the delegate invocation to its own thread and invoke it there.
Think of the Control as having a message queue somewhere. When you call BeginInvoke on a different thread than the one that the control is running on, the Control puts your deletate on its queue and eventually invokes it from its own thread.
|
|
|
|
|
well if data communication is needed to take place between two computers,what do i need,i mean ,what sort of knowledge is needed.
|
|
|
|
|
Is this a reply to my reply below ? If so, keep on the same thread.
That depends. Are they on a local network ? Are they connected to the Internet ? How will they talk ? What sort of data do you want to pass ? In what direction ?
I'd lean towards writing a web service for this sort of thing, if that is possible. It's just nice and clean. But, it depends on your needs.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I'm looking for a book for C# that is similar to a book like the Developer's Dictionary series. The Developer's Dictionary series gives you a huge book with practically everything you need to know. I've found my JavaScript: Developer's Dictionary to be EXTREMELY helpful, and I'd like to have a book similar, but on C#. Does anyone know of such a book?
-----
Note: *** Never give me an answer have anything to do with Visual Studio. I don't have this program, and it'll be that way for a long, long time. ***
|
|
|
|
|
You'd do better to refer to msdn.microsoft.com[^], or install the MSDN help that comes with VS, for that sort of help. You'll save a few trees, as well.
And, you can always ask questions here ( but I understand you're asking about a comprehensive reference ).
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
try for the complete reference series on C#.
Keshav Kamat
India
|
|
|
|
|
can any one guide me,how can we exchange the data in c#???????????
s_khan
|
|
|
|
|
Who do you want to exchange it with ? If you mean between forms, delegates are the most flexible, but just passing through a constructor or a public property often works.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I was using the return character to evaluate the input of a textbox via the keypress event.
private void textBoxInput_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == '\r')
{
e.Handled = true;
}
}
After turning on autocomple the keypress event is no longer triggered when the pressed key is the return key. Does anyone know a way around this?
Thanks
Karl
|
|
|
|
|
when you use autocomplete and choose a text from the autocomplete list, its sure that it wll not trigger the keypress event because you are not pressing keys onthe keyboard.
try validating the text in the textbox again before you will use it.
Signature has been encrypted
|
|
|
|
|
Thanks for your reply.
It doesn't matter if the text is chosen from the autocomplete list or the person is typing in something completely new. The return key never fires a keypress event anymore. Every other key fires the event. The return key instead causes the text to be highlighted.
I am not sure what you mean by validating the text in the textbox before using it. I currently do not validate the text, anything can be entered in the box.
Thanks.
Karl
|
|
|
|
|
After further investigation it turns out that auto complete only intercepts the keypress event for the return key. The keypress event gets fired appropriately with any other key. The other keyboard events such as keyup and keydown are unaffected by this issue so they can be used as a work around.
If anyone knows more about this issue please reply.
Karl
|
|
|
|
|
from a winform gui control a button or a event should run a command on the cmd.exe in the backend and how to capture the output of it in a string and desplay in a textbox
similarly if i have to issue/get multiple command and its correspondig output in hashtable,
eg, cmd1 its output
cmd2 output
cmd3 output
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|
|
Process.StandardOutput Property [^]
Take a look at the example.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
|
Hi. I want to develope a software like windows or antiviruses.
It means i want to fix my programs problems or update some parts of it without recompiling it or installing it again.
For more information "like stored procedure programming" that doesn't need
any program recomipling I want to change my softwares updates
in customer's computer without installing new version of my softweare and
just install or copy it's service pack!
Shall i create dll base forms and is it possible?
Which reference can help me about this?
Tank you
|
|
|
|
|
freshonlineMax wrote: It means i want to fix my programs problems or update some parts of it without recompiling it or installing it again.
you always need to recompile the code you've changed. You can distribute some code in dlls which the main program can use, and thus not have to update the main program. You can also use ClickOnce to write an installer that updates the program automatically when a new version is available.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Storage;
using Microsoft.Xna.Framework.Content;
The type or namespace name 'Xna' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
I found this Xna/DirectX example in the Visual C# 2005 Express Edition help files.
But when I tried to compile it I got the error listed above.
I looked for this error and read somewhere that it was a bug. Which hadn't been fixed yet.
Is this true? And what do I do now if I want this program to run?
Ranger.
Novice
|
|
|
|
|
Ranger49 wrote:
I looked for this error and read somewhere that it was a bug. Which hadn't been fixed yet.
Impossible.
It looks to me like the error message is right, you need to have the Xna framework downloaded and installed, and you need a reference to it in your project.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: Xna framework downloaded and installed,
I downloaded Xna Game Studio Express and if I understand it correctly that you then no longer need to install the Xna Framework because it was already installed with Game Studio?
I find this really interesting, but I think I will need to buy me a book about it.
Only a few days ago I figured that DirectX would be interesting to program and now I am already contemplating programming Xna class routines!!!
Anybody have any advice for me?
Ranger.
Novice
|
|
|
|
|
Ranger49 wrote: and if I understand it correctly that you then no longer need to install the Xna Framework because it was already installed with Game Studio?
Probably. You still need to add a reference to your project, tho.
Ranger49 wrote: Only a few days ago I figured that DirectX would be interesting to program and now I am already contemplating programming Xna class routines!!!
My core advice would be: a tutorial will have you entering code that works pretty quickly. Make sure you have a grounding in C# in general before getting in too deep, and make sure you take the time to understand what everything you work on does, before moving on to something else. Otherwise, you're not really learning.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|