Click here to Skip to main content
16,021,905 members
Home / Discussions / C#
   

C#

 
AnswerRe: Really no way to free an object ? Pin
boogs5-Feb-04 8:51
boogs5-Feb-04 8:51 
AnswerRe: Really no way to free an object ? Pin
scadaguy5-Feb-04 8:53
scadaguy5-Feb-04 8:53 
GeneralRe: Really no way to free an object ? Pin
Andres Coder5-Feb-04 9:23
Andres Coder5-Feb-04 9:23 
GeneralRe: Really no way to free an object ? Pin
scadaguy5-Feb-04 9:38
scadaguy5-Feb-04 9:38 
GeneralRe: Really no way to free an object ? Pin
Andres Coder5-Feb-04 9:45
Andres Coder5-Feb-04 9:45 
GeneralRe: Really no way to free an object ? Pin
scadaguy5-Feb-04 13:56
scadaguy5-Feb-04 13:56 
GeneralCan't call a method with parameters when opening a thread Pin
Peter Mills5-Feb-04 7:27
Peter Mills5-Feb-04 7:27 
GeneralRe: Can't call a method with parameters when opening a thread Pin
Bill Dean5-Feb-04 8:39
Bill Dean5-Feb-04 8:39 
Hi Peter,

As far as I know, the function name that you use to construct the Threadstart must return void and take no parameters.

The work-around I've used (and please tell me if this is bad!!!) is to create a class, stuff the "parameters" into properties on the class and then call a method on the class to do the work...for example:

<br />
public class WorkAround{<br />
    public int iParameter1;<br />
    public int iParameter2;<br />
    public WordAround (int P1,int P2){<br />
        this.iParameter1 = P1;<br />
        this.iParameter2 = P2;<br />
<br />
    }<br />
    public void DoWork(){<br />
        //Do the work here...invoke queryServerRange (iParameter1,iParameter2) here!<br />
    }<br />
}<br />
<br />
...<br />
<br />
WorkAround WA=new WorkAround (0,int.Parse(servers.Count.ToString())) ; <br />
Thread queryRangeThread = new Thread( new ThreadStart( WA.DoWork ));<br />
queryRangeThread.Start();<br />
<br />


I'm sure I've made a mistake or two above...but you get the idea: stuff your parameters into properties on a class you define and then call a method on the class the conforms to that requirements of ThreadStart()

Hope this helps,
Bill
GeneralRe: Can't call a method with parameters when opening a thread Pin
boogs5-Feb-04 8:42
boogs5-Feb-04 8:42 
GeneralRe: Can't call a method with parameters when opening a thread Pin
Heath Stewart5-Feb-04 18:04
protectorHeath Stewart5-Feb-04 18:04 
GeneralRe: Can't call a method with parameters when opening a thread Pin
Peter Mills7-Feb-04 14:26
Peter Mills7-Feb-04 14:26 
Generalremoving registry garbages Pin
Shahin775-Feb-04 6:23
Shahin775-Feb-04 6:23 
GeneralRe: removing registry garbages Pin
Heath Stewart5-Feb-04 6:38
protectorHeath Stewart5-Feb-04 6:38 
GeneralJava vs. C# means file watcher problems Pin
RB@Emphasys5-Feb-04 6:22
RB@Emphasys5-Feb-04 6:22 
GeneralRe: Java vs. C# means file watcher problems Pin
Heath Stewart5-Feb-04 6:47
protectorHeath Stewart5-Feb-04 6:47 
GeneralRe: Java vs. C# means file watcher problems Pin
RB@Emphasys5-Feb-04 7:08
RB@Emphasys5-Feb-04 7:08 
GeneralWeb Service error Pin
Peter Greenall5-Feb-04 5:55
Peter Greenall5-Feb-04 5:55 
GeneralImpersonation and FileSystemWatcher (threading?) Pin
Bill Dean5-Feb-04 5:47
Bill Dean5-Feb-04 5:47 
GeneralRe: Impersonation and FileSystemWatcher (threading?) Pin
John Fisher5-Feb-04 6:00
John Fisher5-Feb-04 6:00 
GeneralRe: Impersonation and FileSystemWatcher (threading?) Pin
Bill Dean5-Feb-04 6:08
Bill Dean5-Feb-04 6:08 
GeneralRe: Impersonation and FileSystemWatcher (threading?) Pin
Heath Stewart5-Feb-04 6:29
protectorHeath Stewart5-Feb-04 6:29 
GeneralRe: Impersonation and FileSystemWatcher (threading?) Pin
Bill Dean5-Feb-04 6:54
Bill Dean5-Feb-04 6:54 
GeneralRe: Impersonation and FileSystemWatcher (threading?) Pin
Heath Stewart5-Feb-04 8:51
protectorHeath Stewart5-Feb-04 8:51 
GeneralRe: Impersonation and FileSystemWatcher (threading?) Pin
Bill Dean5-Feb-04 9:26
Bill Dean5-Feb-04 9:26 
GeneralRe: Impersonation and FileSystemWatcher (threading?) Pin
Bill Dean5-Feb-04 16:00
Bill Dean5-Feb-04 16:00 

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.