|
You do know that only the starting method is the only
one that can not take parameters.
|
|
|
|
|
i know... but that's the only one I care about... ideas?
/\ |_ E X E GG
|
|
|
|
|
|
Create a class to hold your parameters and that class has the method you want the new thread to start running & pass the instance method as the constructor parm to your thread.
ex:
class MyThreadWorker
{
public string MyParm;
public void MyMethod(void)
{
// Do stuff w/ MyParm
}
}
...
MyThreadWorker w = new MyThreadWorker()
w.MyParm = "WooHoo";
Thread thread = new Thread(new ThreadStart(w.MyMethod));
...
|
|
|
|
|
Thanks for you help.....
uh... it wasn't working for a while, until I realized there was no thread.Start()....
anyways, it works now. thanks.
/\ |_ E X E GG
|
|
|
|
|
|
Got a project on hand, but they need to implement to the Win32 DLL in order
for the call from the framework. Is it possible or means that I have to
switch to VC++. Nightmire if have to do that.
|
|
|
|
|
No, C# project cannot be compiled to a Win32 DLL. You may build a .NET component, then wrap that within a COM Callable Wrapper, but that would still require .NET run-time to run.
|
|
|
|
|
|
i used WMI to get disk c and set disk["VolumeName"] but it's not working???
help me
|
|
|
|
|
Help Me!!!!
SOS
|
|
|
|
|
I found a solution
see http://www.dotnet247.com/247reference/msgs/24/122501.aspx
string VolumeName= disk.Properties["Volumename"].Value.ToString();
disk.Properties["Volumename"].Value = "Happy_4th";
PutOptions poptions = new PutOptions();
poptions.Type = PutType.UpdateOnly;
poptions.UseAmendedQualifiers = true;
disk.Put(poptions);
|
|
|
|
|
AFTER my application comes up, if there is no file stored in the registry, it needs to popup a dialog asking if the user wants to search for a file to open, create one or exit.
I can't figure out where to put this dialog. I tried in OnActivated, but I can't close the application from there (unless I'm doing it wrong, which wouldn't surprise me.)
NOTE: THE APPLICATION MAIN FORM MUST ALREADY BE DISPLAYED!
Any help would be greatly appreciated.
When all else fails, there's always delusion.
- Conan O'Brien
|
|
|
|
|
if (OpenFileDialog.Show() == DialogResult.Yes)
Applcation.Run( new MainForm(OpenFileDialog.Filename));
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
You misunderstood, the main form of the application MUST already be displayed.
When all else fails, there's always delusion.
- Conan O'Brien
|
|
|
|
|
You can put the dialog into OnLoad and call Show(). The form is already loaded in OnLoad.
private void Form1_Load(...){<br />
this.Show();<br />
<br />
MyDialog dlg = new MyDialog();<br />
dlg.ShowDialog();<br />
}
|
|
|
|
|
That mostly works, thanks.
When all else fails, there's always delusion.
- Conan O'Brien
|
|
|
|
|
I have a listview that i added with VS.NET, but eventually I want to modify one of the images in the listview when an event handled like this happens
rasClient1.DialStatus += new RasClient.DialStatusEventHandler(DialStatusChg);
the problem is that when im in DialStatusChg and I try to modify the listview like the code below the application stops responding, any idea how can i modify the listview from there, what I'm trying to do is something like a semaphore, so when that event happens, the method below updates the images in the listview
private void DialStatusChg(object sender, DialStatusEventArgs e)
{
try {
switch (e.ConnectionState.ToString())
{
case "AuthNotify":
((ListViewItem)lvLights.Items[2]).ImageIndex = 1;
break;
}
catch (Exception exc)
{
Console.WriteLine(exc.Message);
}
}
Thnx in Advance
Isaac
|
|
|
|
|
Threads, thread, threads...
You will have to use Control.Invoke(object obj, object[] param).
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
I want to open an Excel file in my C# application and read the contents . I tried the msdn samples. But most of them deal with writing back values into Excel file.
Also since the range of values that I have to read from the Excel file is dynamic, I would like to know how this can be done.
The foll. is the code that I have written and I get error while instatiating an Excel aplication obejct as it is not able to understand my typecasting.
Excel.Application objApp=null ;
Excel.Workbooks objBooks=null;
Excel.Workbook objBook= null;
Excel.Range range;
string str="";
try
{
// Instantiate Excel and start a new workbook.
objApp = (Excel.Application)new Excel._ExcelApplicationClass();
objBooks = (Workbooks)objApp.Workbooks(1);
objBook = (Workbook)objBooks.Open(DataFile,null,null,null,null,null,null,null,null,null,null,null);
Excel.Worksheet ws= (Worksheet)objBook.Worksheets(1);
if (ws == null)
Console.WriteLine ("ERROR: worksheet == null");
Excel.Range rng=(Excel.Range)ws.Cells(1,1);
str=rng.Value.ToString();
|
|
|
|
|
Hello ....
I have a form of a TextBox control that has a bunch of limitations on it that I need for an app I'm developing.. works well as its own control on a form, etc..
I'd like to use that control as a column in a DataGrid, but I'm not sure how to 'adapt' the custom control to work in the DataGrid (I'm getting a "Cannot implicitly convert type 'CapsText.CapsTestControl' to 'System.Windows.Forms.DataGridColumnStyle'" message).
Any suggestions on what I need to do to fix this?
Thanks!
|
|
|
|
|
The help says the Item function will give me whatever item in the list I want but the complier says there is no definition for this function. What's up with that?
|
|
|
|
|
You mean an element in the arraylist, don't you ?
Can you submit some sample ?
Free your mind...
|
|
|
|
|
You use the indexer "[]"
eg
ArrayList a;
...
object o =a[2];
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
Hi!
I want to create a application which have a tab control in where it should host a axwebbrowser for each tab.
So far no problem, but everytime i add a new instance of the axwebbrowser it creates about 10mb more memory usage.
And thats not nice ... i know that you can copy instance with
axwebbrowser2 = axwebbrowser1
but then you have to set the location configs again to them and i mean it's not the nicest and cleaniest way
to do this! And the axwebbrowser1 is gone, so if i go back to the first tab i have to copy it back
axwebbrowser1 = axwebbrowser2
and add the location config again to the first webbrowser.
I searched for this on Google and here at CP but i can't find any solution. Maybe someone can help me out of this
Thanks
Matthias
|
|
|
|