|
I have a GUI with multiple TextBox and ComboBox controls. These controls are bound to a datasource and are update via the CurrencyManager. How can I detect when a user has started to modify the text in one of the controls?
If I advance to the next record I can check the status of the CurrencyManger and determine is the previous row has changed. I want to be able to detect that the row is changing before the user has advanced (or retreated) rows.
Currently I am thinking that I will need to enable the TextChanged event for each control (controls are created dynamically) and use that to determine if an edit has happend and then disable the event when the user advanced to the next row, and then reenable after the controls have populated with data.
Is that a good way?
Thanks.
www.lovethosetrains.com
|
|
|
|
|
I have a class library which prints a report directly from reporting services. I have a few Console.WriteLine statements. When i insert this library in my main application and use it i see the Console.WriteLine info written in the debug window of the .NET IDE. What i would like is to use this info in my own application. Is there a way to print this information somewhere in let's say a textbox of my main application ?
|
|
|
|
|
If you use System.Diagnostics.Trace.WriteLine (you can't use formating [with '{0}'] directly with this) instead of System.Console.WriteLine , you can tell your App to get the Trace Data with
System.Diagnostics.TextWriterTraceListener traceListener = new System.Diagnostics.TextWriterTraceListener( {a stream to receive the Trace Messages} );
I don't know if you can also redirect the System.Console.Out Stream.
Greets
Roland
Wenn der Computer wirklich alles kann, dann kann er mich mal kreuzweise.
(Manfred Schmidt)
Follow your Euro notes in their tracks
|
|
|
|
|
You can always redirect console output to your own stream, provided you launch the process.
You can write a tiny bootstrapping application that launches your main application after redirecting standard output and also captures console output. Something like
class BootStrapper
{
StreamReader reader;
public static void Launch()
{
ProcessStartInfo info = new ProcessStartInfo();
info.RedirectStandardOutput = true;
...
Process p = Process.Start(info);
reader = p.StandardOutput;
new Thread(new ThreadStart(ConsoleReader)).Start();
}
private void ConsoleReader()
{
string line = null;
while ((line = Process.GetCurrentProcess().StandardOutput.ReadLine()) != null)
{
}
}
}
Or you can replace calls to Console.WriteLine with Trace.WriteLine and use the method that the other poster suggested.
Hope this helps.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
yeah this helped for sure thanks a lot to both of you !
|
|
|
|
|
In Visual Studio 2003, when you add an xml comment (with '///'), the IDE helps you with the intellisense to remember the tag names. As NDoc adds some tags (<exclude /> as an examle), it would be nice to have support for this tags in the intellisense.
Is it possible to extend/adapt the list of tags and its structure (the schema), and how? I've searched in the folder of the ide for a schema file or something like this, but was not successfull.
Thanks
Roland
Wenn der Computer wirklich alles kann, dann kann er mich mal kreuzweise.
(Manfred Schmidt)
Follow your Euro notes in their tracks
|
|
|
|
|
how a tcp server running on given uri like "soap:tcp://localhost:8080/MyReceiver" will return wsdl. In normal web service case which runs on http returns wsdl by simply appending '?wsdl' in url, but I am confused how a tcp server will do the same.
plzzzzzzzzz reply !!
thanks in advance
iffi
|
|
|
|
|
You an use the url with wsdl query string
as
http://localhost/myservice.......?wsdl
Shahzad Raja
|
|
|
|
|
Thanks raja jee..
But i have tried the way u suggested...
http://localhost/myservice.......?wsdl
but its not working cz myservice is running on TCP over SOAP
soap:tcp://localhost/myservice.......?wsdl
I dont think so we can access tcp service using http request..
looking forward
|
|
|
|
|
Are there any issues with connecting to the ORACLE 10g database through C# .Net? I will be using OracleClient namasapce for the same. Let me know if there are any issues with that too.
The OracleClient namespace is available only when we install Oracle client components in the development environment. Do we need the oracle client components to be installed on the production machine as well when we deploay the application or the corresponding dll are enough?
Thanks in advance. Let me know this as soon as possible, because I have to select the backend for my project.
|
|
|
|
|
Hi
I have made window service installer setup
In this program i am using the follwing code inside OnStart
Process.Start(@"c:\sanjeev\farm.exe");
here i have include the whole hard coded path but i do not want to give there the path . Path should be taken from another set up file which is given below
I have made another installer for my Project ( product) which includes help file ,its self product.
THe second setup of my product works file . but when i install the first one setup windows service installer i need to know the path of second one exe file i.e the path of farm.exe
can anybody tell me how can i retrive the path of my product 's exe bec windows installer should automatically know the path of farm.exe file
can anybody tell me
is there any method to integrate my windows service installer and my product installer
Everything is possible
|
|
|
|
|
Hi,
I need to know how to capture the killing of a C# windows application from task manager.Does any event of the application can be trapped to know this.
Please let me know your suggestions
Thanks
|
|
|
|
|
Task Manager first tries to shut your application down normally. This is no different than someone clicking the close button of your form. If your app doesn't respond, you'll get the "End Task" box. This is where the application isn't shutdown, but is just stopped and removed from memory, uncleanly.
If your application is the one being shut down, the only notification your going to get is the Closing event. If your application is hung, you'll never see the event.
If your trying to get notification of another app being shutdown, you can use the Process class WaitForExit method. I'm not saying that this will be a sure fire method for getting a notification, but it's a start.
But, there is no event that says another application is being terminated from TaskManager.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
The Form_Closing event is not getting called when I kill the applications'exe from the task manager.Though it is called when the Form is killed or manually closed using the close button.
Could you please help on this.
Thanks
|
|
|
|
|
My mistake. WM_CLOSE messages are not posted to the windows, but WM_QUIT is.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Does anyone know of a detailed rational of the choices and decisions made in implementing generics in C# 2.0?
There are good reasons why Generics are not implemented as C++ templates but in some areas it seems that some aspects of the C++ method could have been implemented and would have been superior.
The difference that most concerns me is that with C++, template methods are (normaly) only instantiated if they are referenced and this allows templates to support extra functionality if the parametric class supports it.
For example: I want to create a general struct Pair<T1,T2> . I must immediately decide whether or not it is IComparable and this depends on whether or not its type parameters are constrained to be IComparable .
I no see reason (other than devising a syntax) why implementation of the interface should not be conditional on a where clause restriction on the parametric types.
The parametric restriction of methods is even simpler in principle since a syntax already exists for generic methods that would just need to be extended to allow reference to the parametric types of the class - If the class parameters did not satisy the where clause then the method would not exist and couldn't be called.
A very simple example of my idea:
class Pair<T> : (IComparable where T: IComparable)
{
T first;
T second;
public int CompareTo(object other) where T: IComparable
{
int r1 = first.CompareTo(other.first);
return r1 != 0
? r1
: second.CompareTo(other.second);
}
}
Obviously the compiler would have to verify that the constraints on the interface gaurantee the constraints on the methods needed to implement it.
|
|
|
|
|
Firstly, how is your example different from the implemented generics in 2.0? I can write the same class as
class Pair<T> : IComparable where T: IComparable
{
T first;
T second;
public int CompareTo(T other)
{
...
}
}
Maybe I'm failing to see your point.
As far as why .NET generics are different from C++ templates, it's because with C++, all template instantiations are known at compile time! With a .NET assembly, your dll or exe could be loaded by someone else and could try to make invalid instantiations of your generic class after compile time.
Take for instance the following class:
class MyGenericDotNetClass<T>
{
void FooBar(T foo)
{
foo.Yippie();
}
}
This would work as a C++ template, provided that any code that instanciates this class will provide a generic parameter type that has a .Bar() method. With a C++ template, if you said new MyGenericDotNetClass<sometypewithyippiemethod>(), then this would work because the C++ compiler would verify that the .Yippie() method exists for type SomeTypeWithYippieMethod.
.NET, on the other hand, can't depend solely on compile-time checking. Sure, the compiler could check to see if all your code that instantiates this class does so with a type that has a .Yippie() method. However, .NET code is easily shareable between components; a Visual Basic.NET application my load up your MyGenericDotNetClass and with a generic parameter of SomeTypeWithNoYippieMethod(). Of course, the VB.NET compiler could issue an error message, however, we'd then start getting into long, cryptic error message akin to C++ template compiler erros about bad instantiations because no .Yippie() method exists on the proposed generic type. Obviously, this is a quite simple example, real-world code would get much hairier than this. So the .NET designers decided that if you want functionality out of your generic class, you have to specify it explicitly in the form of a constraint.
Ian Griffiths has a good article on his blog here[^] about this very topic.
IMO, generics in .NET is pretty well done. I like it, it's useful, and saves a lot of development time. I think the only change I'd make is for the value types to have an arithmetic constraint of some sort, allowing generic types to easily add, subtract, multiple, divide, etc. But I hear there are plans for this in .NET version 3.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Conversation With a Muslim
Judah Himango
|
|
|
|
|
You miss the point - Your Pair<T> can only be instantiated with a class implementing IComparable even if, for some particular use, the IComparable part of the functionality is not required.
My class can be seen as two classes with the same name - one of which implements IComparable and one of which does not. All that is required is for the compiler to pick the right one based on the constraints. No CLR/JIT changes would be required because it would all be handled by the compiler.
You might say that you should just have two generics Pair<T> and ComparablePair<T> but, apart from the fact that this is ugly, consider generic collections: either they are restricted to IComparables or they cannot be comparable themselves so then you need Col<T> and ComparableCol<T> for every collection type and, in general, the deeper you nest generics and the more interfaces you consider the more you find that you must either give up your functionality or seriously constrain the parameters that you use.
[Obviously you can always implement IComparable and use runtime casting and throw exceptions if T isn't itself IComparable but that is inefficient, ugly and a serious cause of errors]
|
|
|
|
|
Nick Hounsome wrote:
You miss the point
I figured I did. I'm understanding it now.
Yeah, it's an interesting idea. Gives you more flexability in the types you can instantiate the generic type with, but also puts a burden on developers as far as the "implements IFoo where T implements IFoo" part, but interesting nonetheless. Maybe you could offer this as a suggestion at MSDN labs.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Conversation With a Muslim
Judah Himango
|
|
|
|
|
Hi,
I want to serialize and deserialize objects that has fields with åäö in the names.
serializing them works fine, but deserializing doesnt work and the formatter complains about invalid chars in the tag names.
is there any workaround for this?
|
|
|
|
|
I am a C programmer attempting to learn C# and the problem I have is that I need to call/execute an external program from within a C# program I have written.
Please tell me how to do this.
Regards,
Alf Stockton
|
|
|
|
|
Try this
using System.Diagnostics;<br />
.<br />
.<br />
.<br />
.<br />
Process.Start(@"C:\Softwares\Ws_Ftp\WS_FTP95.exe");
<font=arial>Weiye Chen
Life is hard, yet we are made of flesh...
|
|
|
|
|
Gee that is easy enough. Thank you.
|
|
|
|
|
You are welcomed.
<font=arial>Weiye Chen
Life is hard, yet we are made of flesh...
|
|
|
|
|
Process.Start appears to only be able to start a process on the same machine.
Is there a way to start a process or preferably a php program on a remote machine.
What I want is to call a php on the server from a C# program on a workstation.
Regards,
Alf Stockton
|
|
|
|