Click here to Skip to main content
15,890,845 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i am having problem .. last time i was using this piece of code and it was wroking fine.
C#
Thread thread = new Thread(new ThreadStart(TMDBDownload));
thread.Start();

but now i use this it doesn't bring me into the function"TMDBDownload" i put some break point in the function when i step into its just get over it .. doesn't go inside. last time i made application on windows xp 32 bit operating system.. i puted some controls on the from...

but right now i am using Windows7 64bit and i used tab Control on the form and putted some textboxes and labels and buttons etc. when i click the button there is a function i made that by myself having name "TMDBDownload" thread doesn't call that function i think. there must be something wrong or what i don't know..

i am looking forward for your reply as soon as possible.

Best,
Ans.
Posted
Updated 21-Mar-12 22:04pm
v2

1 solution

There is nothing wrong in these two lines (except excessive new ThreadStart which does not hurt). The problem is somewhere outside those two.

First of, all, let me offer you the good way of working with threads by using a thread wrapper. Please see my past answers:
How to pass ref parameter to the thread[^],
change paramters of thread (producer) after it started[^].

I could also bring you to the right idea.

—SA
 
Share this answer
 
v2
Comments
Sheikh ans 22-Mar-12 4:49am    
its doesn't allow me to get inside the function .. i just want that the function should run. if i put a break point inside the function the debugger must notify me that you are on break point. can you please write here the code for that.
[no name] 22-Mar-12 9:12am    
The code for a break point? As stated, there is nothing wrong with that snippet of code that you posted. Whatever problem you are really having lies elsewhere.
Sergey Alexandrovich Kryukov 22-Mar-12 15:56pm    
Broken debugger..? :-)
Maybe everything works somehow already, OP just needs to test it by adding, say, logging from the thread...
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900