Click here to Skip to main content
15,917,862 members
Home / Discussions / C#
   

C#

 
QuestionC# directX how to? Pin
mercenary018-Jul-07 19:00
mercenary018-Jul-07 19:00 
AnswerRe: C# directX how to? Pin
DMWhiteDragon8-Jul-07 19:10
DMWhiteDragon8-Jul-07 19:10 
QuestionC# ListBox Justify Text Pin
fjlv20058-Jul-07 17:51
fjlv20058-Jul-07 17:51 
AnswerRe: C# ListBox Justify Text [modified] Pin
DMWhiteDragon8-Jul-07 18:23
DMWhiteDragon8-Jul-07 18:23 
AnswerRe: C# ListBox Justify Text Pin
Luc Pattyn9-Jul-07 2:28
sitebuilderLuc Pattyn9-Jul-07 2:28 
Questionregarding XML Pin
praveenanand8-Jul-07 17:48
praveenanand8-Jul-07 17:48 
AnswerRe: regarding XML Pin
Sathesh Sakthivel8-Jul-07 17:51
Sathesh Sakthivel8-Jul-07 17:51 
QuestionTimer Class Help Pin
DMWhiteDragon8-Jul-07 16:14
DMWhiteDragon8-Jul-07 16:14 
Ok to start i'll tell you what im doing, I have a InterOpWindow class that i created. It basically allows me easy talking between Process's and Thread's allowing me to just send strings all over however i like.

eg, to setup a window to talk to:
C#
<br />
InterOpWindow MyCommandWindow = new InterOpWindow("some_window_name");<br />
MyCommandWindow.evDataCommandRecieved += new InterOpWindow.delDataRecieved(OnDataCommandRecieved);<br />
<br />
static void OnDataCommandRecieved(string sData)<br />
{<br />
	MessageBox.Show("Data: " + sData);<br />
}<br />

and to send data and check a window reference:

C#
<br />
InterOpWindow.SendRemoteMessage("some_window_name", "my data message");<br />
InterOpWindow.CheckRemoteWindow("some_window_to_check");<br />


Nice and easy... just how i like it, im happy i got it working as i've only been C# coding for about 3 weeks heh.

Which is where i come to my problem with the timer class. What i assumed was fine was to keep enabling and disabling it to start and stop the monitoring process for command sending timeouts. However after the timer being used (and working) it seems to be 'dead' if i try to disable then enable it... the Tick event never fires.

Is the object being disposed? does it need a container to stay active? any thoughts would be great...

For now im just leaving it enabled for good and using a var to count around 3 ticks (1 second each) for timeout.

Of course i could have just stuffed up completely and its something small... ya never know Wink | ;)

C#
<br />
public class InterOpWindow : NativeWindow<br />
{<br />
    ...<br />
    private Timer tmrTimeout = new Timer();<br />
    ...<br />
    public InterOpWindow(string sLocalWindowName)<br />
    {<br />
        ...<br />
        tmrTimeout.Tick += new EventHandler(tmrTimeout_Tick);<br />
    }<br />
}<br />


thats basically how i've set it up, any ideas would be great... thanks Smile | :)


Always more to learn, and i wouldn't have it any other way.

AnswerRe: Timer Class Help Pin
Luc Pattyn8-Jul-07 16:48
sitebuilderLuc Pattyn8-Jul-07 16:48 
GeneralRe: Timer Class Help Pin
DMWhiteDragon8-Jul-07 17:03
DMWhiteDragon8-Jul-07 17:03 
GeneralRe: Timer Class Help Pin
Luc Pattyn8-Jul-07 17:15
sitebuilderLuc Pattyn8-Jul-07 17:15 
GeneralRe: Timer Class Help Pin
DMWhiteDragon8-Jul-07 17:29
DMWhiteDragon8-Jul-07 17:29 
JokeRe: Timer Class Help Pin
Luc Pattyn8-Jul-07 17:31
sitebuilderLuc Pattyn8-Jul-07 17:31 
Questionwebsite Login with c# Pin
cardy18-Jul-07 15:14
cardy18-Jul-07 15:14 
AnswerRe: website Login with c# [modified] Pin
DMWhiteDragon8-Jul-07 16:30
DMWhiteDragon8-Jul-07 16:30 
AnswerRe: website Login with c# Pin
Ravi Bhavnani8-Jul-07 19:15
professionalRavi Bhavnani8-Jul-07 19:15 
QuestionGISMAP Pin
sarvenaz848-Jul-07 11:58
sarvenaz848-Jul-07 11:58 
AnswerRe: GISMAP Pin
Christian Graus8-Jul-07 16:18
protectorChristian Graus8-Jul-07 16:18 
Questionhow to connect C# application with j2me application? Pin
amna_am8-Jul-07 11:38
amna_am8-Jul-07 11:38 
AnswerRe: how to connect C# application with j2me application? Pin
Christian Graus8-Jul-07 11:41
protectorChristian Graus8-Jul-07 11:41 
GeneralRe: how to connect C# application with j2me application? Pin
Paul Conrad8-Jul-07 12:17
professionalPaul Conrad8-Jul-07 12:17 
Questionhelp me please Pin
michaelqog8-Jul-07 11:11
michaelqog8-Jul-07 11:11 
AnswerRe: help me please Pin
Judah Gabriel Himango8-Jul-07 11:42
sponsorJudah Gabriel Himango8-Jul-07 11:42 
AnswerRe: help me please Pin
Christian Graus8-Jul-07 11:43
protectorChristian Graus8-Jul-07 11:43 
AnswerRe: help me please Pin
Paul Conrad8-Jul-07 12:22
professionalPaul Conrad8-Jul-07 12:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.