|
In a multithreaded environment you can have mulitple things happening at the same time, especially in a multicore or multiprocessor environment.
So, how does your solution work if you want to start several threads at the same time?
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton
My website
|
|
|
|
|
In .Net 1.1 the ThreadStart never takes a parameter, so you the method which is called on a new thread will have to access the object stored some where else. But keep in mind to make thread safe.
Though this is now possible in 2.0 using Annonymous Methods.
Hope, it is clear now
|
|
|
|
|
If threads need different parameters we can name each thread (or group of) and use static hash table (dictionary) to store the parameters.
P.S. I think it is good way to solve this. But I have never worked with FW 1.1. May be it has a different recommended solution
|
|
|
|
|
you could do this:
create a class that will execute on the thread.
public class ThreadObj
{
private int t1;
private string t2;
public int T1
{
get
{
return t1;
}
set
{
t1 = value;
}
}
public string T2
{
get
{
return t2;
}
set
{
t2 = value;
}
}
public void MyThreadMethod()
{
string t = t2;
}
}
then call this with :
ThreadObj o = new ThreadObj();
o.T2 = "Hello";
o.T1 = 1;
System.Threading.ThreadStart ts = new System.Threading.ThreadStart(o.MyThreadMethod);
System.Threading.Thread tr = new System.Threading.Thread(ts);
tr.Start();
|
|
|
|
|
Hello friends!
I was programming redirection of output from console process(C# .Net 2.0), but when i'm outputing it on form it outputs illegal characters(cyrillic characters).
Could you help me how to convert this cyrillic output from the console app to unicode?
Thanks.
-- modified at 6:15 Friday 8th June, 2007
|
|
|
|
|
hi,
did you try System.Text.UnicodeEncoding... or System.Text.Encoding.Unicode....
hope that helps
regards
|
|
|
|
|
Hello guys
in dot net 2.0 we have generic list in system.collection.generic ,
but not in dot net 1.1 , so how can we achieve that functionaly in dot net 1.1 , is there any way ?
thanks in advance
hello
|
|
|
|
|
I think not. Generics have been introduced to C# with version 2.0 of the language.
|
|
|
|
|
You write a class that contains an ArrayList and offers typesafe methods to add and remove items from the list.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Use the C++ preprocessor :p
|
|
|
|
|
Hi,
I have created an Outlook AddIn in C#. After installing successfully it on client machine I am getting an error while loading it in Outlook 2007. "Not Loaded. A runtime eror occurred while loading". I am using .Net 2.0, Visual Studio 2005, MS Office 2007 and VSTO2005 SE. Even I tried to set and reset project property "Trust Assembly Location". But same problem.
Please reply as soon as possible.
Thanks & Regards
|
|
|
|
|
Hi.
I want to find out the path to the AcrobatReader executable file in case it is installed on the local computer.
For this I must search the registry.
What key should I look for?
I saw with regedit.exe that \HKEY_CLASSES_ROOT\acrobat\DefaultIcon has the exact value I need(path to acrord32.exe). But is this right?
object obj = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey("acrobat").OpenSubKey("DefaultIcon").GetValue(""); <br />
return obj.ToString();
The above code works, but I don't know that this is the proper way to do it.
What other keys would be indicated?
Note: I must not rely on the fact that AcrobatReader is the default program associated with pdf files, so searching for the default program associated with pdf is rulled out.
Thank you.
|
|
|
|
|
hi
if you look for [HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Acrobat Reader] and it does not return a null value then you have the software installed. then you can open sub-keys to check the version and the location of the exe file.
hope this helps
regards
|
|
|
|
|
Thanks.
But this approach has some issues:
* Nowhere in it's subkeys have I found a reference to the actual exe file, just to the install folder. Have you?
* More importantly, I see that the subkey structure depends on the version of AcrobatReader installed on the machine
Anyway, if I don't find anything better I'll go for a combination of the two solutions.
|
|
|
|
|
hi again
i did found the location from the key - 'InstallPath' and the executable file from the key - 'Language\next'
as for the subkey structure, it depends on the version, but a little research will solve that as well.
i have versions 8 and 5 in my machine and their subkeys are:
v8 - HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Acrobat Reader\
v5 - HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Adobe Acrobat\
hope this helps
regards
|
|
|
|
|
Thanks again.
Could you please share the full name of the InstallPath key for your versions?
I have version 7 and mine is:
HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Acrobat Reader\7.0\InstallPath
|
|
|
|
|
hi,
the full paths are:
[HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Adobe Acrobat\5.0\InstallPath]
[HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Acrobat Reader\8.0\InstallPath]
regards
|
|
|
|
|
I appreciate.
I have version 6 installed on my home computer, so 4 down, 4 for to go.
|
|
|
|
|
well good luck with that.
regards
|
|
|
|
|
I need the C# codes which can convert html to word in .net.
could you plz help me?
Besides, I have looked through http://www.codeproject.com/aspnet/wordapplication.asp
A topic named "Microsoft Word Documents from ASP.NET", this is great !
but , I want to convert html to word in my project instead of write a new document.
thanks in advance.
|
|
|
|
|
1. Create a new blank MS Word document.
2. Stream read it with your C# app.
3. Save the data you get from your stream to be used later as the header of your newly created word docs.
4. Create a new file with the .doc extension.
5. Start writing the header you kept earlier from step 2.
6. Append what ever you want here.
ps. You may have data before and after your data, to check that, go through 1-3, and then open your word document and add any testing text, save it and compare it's data with the previous one to see where's the differences, MS DOS FC is a good tool to do that, fire it from your C# app and store it's outputs.
Cheers.
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
|
Word has never had a problem reading HTML :p
|
|
|
|
|
thanks
|
|
|
|
|
hello all,
i have created an application using visual C#.
can any1 tell me as to how i can convert this application into a *.exe format so that it can be used by any1 who doesnt hac C# installed on his system.
thanks in advance.
|
|
|
|