|
Thanks for the replay,
Actually I want to execute an application(*.exe) through windows service. I've just read the registry to find that application and execute it.
Seems my timer gives a problem.
I'm not clear what you say, as alternative for my project. Actually my application(a server application) completely write using C++. Can you please explain it more.
I appreciate your help all the time...
Eranga
|
|
|
|
|
He's saying writing to the console is useless for a service. You should instead write to a file, or better, the system log.
Cheers,
Vikram.
"I will put my new found knolage to good use" - Captain See Sharp.
"Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed." - Gary Wheeler.
|
|
|
|
|
In your first post you wrote you are using C# (and indeed your code states the same) - so I assume you are not used to C++. In this case you can forget my comment about pointers and co.
|
|
|
|
|
Thanks for all replay.
Actually I've done the job perfectly. Used
ElapsedEventHandler() in
Timer to execute my required function. It works.
Thanks again.
I appreciate your help all the time...
Eranga
|
|
|
|
|
hi
ho can i make my own controls in c# ?
thanks
|
|
|
|
|
hey its simple
start the Visual studio
go for new project
select windows control library
drag and drop the controls (set of controls as u like such as a login form)
run the application
now u can see that a dll is created ( this is ur new control)
now using it just add that dll to ur toolbox and start working ......
regards
sindhu tiwari
its me sid
|
|
|
|
|
You may either use multiple controls to create a custom control (Windows Control Library project), or you may inherit any control and extend its functionality (Class Library project).
Apart from this you may also write a control from the scratch using System.ComponentModel class; however this would be toughest way to do this.
In case if you are planning to create a complex control, it is advisable to check some book related to control creation or use google and check some available samples of custom controls. This would give you more clear idea about the whole process.
-Dave.
Dave Traister,
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
Hi,
I am doing socket programing in that i am using
socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, 1);
I have found info abt setting the keepalive time
1. Click Start, click Run, type regedit, and then click OK.
2. Locate and then click the following key in the registry:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\InternetSettings
3. On the Edit menu, point to New, and then click DWORD Value.
4. Type KeepAliveTimeout, and then press ENTER.
5. On the Edit menu, click Modify.
6. Type the appropriate time-out value (in milliseconds), and then click OK. For example, to set the time-out value to two minutes, type 120000.
7. Restart Internet Explorer.
This is working but its taking more time ...i mean i have set it to 5 minutes and the socket got closed after 20 minutes
so if anyone knows how to set the proper time then plz do let me know
regards
sindhu tiwari
innovative
modified on Tuesday, February 05, 2008 3:48:36 AM
|
|
|
|
|
Hello Friends,
I am developing an windows application in C#.NET and i am using text file to store some predefined responses. Now i want to avoid duplicate entries in text file i am able to achieve some some sort of success in doing that but not fully..
Suppose there is already a sentence in text file
:--- Hello how may i assist you?
now when i enter it again in same format then i get the response duplicate entry that right..
but when i change in case suppose i use
:-- hello how may i assist you?
it get saved in text file i want whenever the string is available in text file whether in UpperCase Or LowerCase it should not save in text file..
|
|
|
|
|
You need to build a dictionary of strings to strings. The key string is all lower case, with spaces and punctuation removed. This means you can't have duplicate entries, then you store the values in the collection, which remain nicely formatted.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
WOW!!
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
Hello!
For that, use case for comparison i.e. change the strings to lower-case/upper-case before comparing both. You can use String.ToLower or String.ToUpper for that.
Hope that will be of some help!
Regards,
Adeel
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
|
Use the overloaded version of String.Compare() that takes a bool parameter. That way, you won't be creating extra objects.
Cheers,
Vikram.
"I will put my new found knolage to good use" - Captain See Sharp.
"Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed." - Gary Wheeler.
|
|
|
|
|
Yes, this will work so long as the case is the only thing that differs.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
i have two object of same class, suppose object name are class1 and class2.
and i have made class1 object and assign it to class2 object.if i do make
chages in class2 then it also affact to class2 object.
but i dont want this.means if i make any changes in class2 then it should not affact to class1 object.
so for thos what should i do.
please help.
amit
|
|
|
|
|
First, calling an object class1 or class2 is a bad idea.
Second, when you say obj1 = obj2; with reference types, you are not assigning one object to another, you are only assigning a reference to another.
amit_83 wrote: if i do make
chages in class2 then it also affact to class2 object.
Yes.
amit_83 wrote: but i dont want this.means if i make any changes in class2 then it should not affact to class1 object.
1. Don't assign the references.
2. If you absolutely must do something of the sort, consider implementing your Clone() method which creates a new object.
Cheers,
Vikram.
"I will put my new found knolage to good use" - Captain See Sharp.
"Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed." - Gary Wheeler.
|
|
|
|
|
Well it's confusing at start but try to think of all "class"-objects as POINTERS or references (in C++).
You've got several possible solutions:
1.) Implement something like Clone (like proposed) - normaly you just add an copy-constructor so you can say MyClass Obj2 = new MyClass(Obj1) and use this in the Clone()-implementation - this way you can save one cast
2.) use struct instead of class - this will locate your objects in the local stack and copy the data instead of the reference when you say (obj2 = obj1)
3.) use the same data to construct the object 2 times with new
etc.
|
|
|
|
|
I have a Panel wherein i place textboxes dynamically. I have set AutoScroll property for the Panel to true. So when the size exceeds automatically Vertical Scroll bar appears.
I place dynamic textboxes in sequential order i.e one after the other row wise. I calculate the exact Location and place the control. This works fine.
The problem happens when i use the scroll bar to scroll down and then add few more TextBoxes. Now the location of the new added Text Box after scroll is not properly placed. Eventhough the calculation is the same. There is more gap between the previous and the next TextBox control. Why?
|
|
|
|
|
Hi,
First you should set the position of the Vertical Scroll into "0", then add the controls to the panel. Now it works fine.
this.panel1.VerticalScroll.Value = 0;
this.panel1.Controls.Add(objTextBox);
Regards,
Gopal.S
|
|
|
|
|
Thanks a lot for your help.
I tried setting the position of Vertical scroll to 0 and it worked.
Regards,
|
|
|
|
|
How to get value of one form to another???
ThanXXXXXXXXX in Advance!!!!
Truth Is The Simplest !!!!
modified on Wednesday, February 06, 2008 2:57:40 AM
|
|
|
|
|
Do you mean one FORM to another ? Use delegates ? There are other ways to do it, they are all wrong in comparison, with the possible exception of passing a value through a constructor. There is at least one good article on this on the site, try searching for it.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thank You!!!
Truth Is The Simplest !!!!
|
|
|
|
|
Can you please give me some guideline for using delegates???
Truth Is The Simplest !!!!
|
|
|
|