473,566 Members | 2,763 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with thread......... ...

hello everybody, please i need your help,
I try to work with thread in c++ , in easiest application work Ok but in
application with thread the class doesn't ....the application show an
critical error that said
"has been a critical error and must be shoutdown ".
the code is:
DWORD WINAPI Controller::Exe cuteThread(PVOI D data)
{
Controller* pt = (Controller*)da ta;
pt->objNavigator = Navigator(pt->currentInstitu tion, pt->currentMode,
pt->visibility, pt->Timeout);
pt->objNavigator.E xecute();
Sleep(1000);
return 0;
}
void Controller::Loa dNavigators(int Mode, int user)
{
HANDLE thread_handle; // this is the handle to the thread
DWORD thread_id;
for(int i=0; i<Controller::_ Institutions.si ze(); i++)
{
Controller::cur rentInstitution = Controller::_In stitutions[i];
Controller::cur rentMode = Mode;
thread_handle = CreateThread(NU LL, 0,&Controller:: ExecuteThread ,this, 0,
&thread_id); // HERE ERROR
Controller::put Results(Control ler::objNavigat or.GetResults() );
Controller::_Se rvicesToExecute = _ServicesToExec ute +
Controller::_In stitutions[i].getCountServic es();
}
}

Please hellppppppppp me
:O(

Mar 2 '07 #1
0 1019

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
6311
by: | last post by:
Hi All, I have allready tried to ask a similar question , but got no answer until now. In the meantime, I found, that I cannot understand some thread-settings for the Main() function . If I use the attribute for the Main() function, I get "access denied error", if I use a ManagementEventWatcher to connect to the local machine to receive...
22
4038
by: Jeff Louie | last post by:
Well I wonder if my old brain can handle threading. Dose this code look reasonable. Regards, Jeff using System; using System.Diagnostics; using System.IO; using System.Threading;
5
3232
by: lltaylor | last post by:
Hello, Help, I am totally stuck, I am trying to write a sample program so I can get to grips with Asynchronous Threads etc... However I can't come up with a good workflow for my program. Any help in what I should be doing/how I should structure my application would be much appreciated. I have written a sample application which...
4
6199
by: Madhu Gopinathan | last post by:
Hi All, I am faced with a horrible hang problem. I have a COM exe server that executes some tasks. The task execution manager is a thread that manages the pool of threads, which is 4 per processor. Each task is processed in a separate thread. Each of the executer threads is an STA thread, and it goes ahead and executes the task. No problems are...
6
4971
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing for long running reports. When the processing is complete it uses crystal reports to load a template file, populate it, and then export it to a...
2
1650
by: SStory | last post by:
Here is the situation. I want to display Icons, Type of file etc from a file extension. Upon initial program load I may only need icons for certain files. But other operations will require showing all filetypes and icons. I have an object that has extension, desc (like Word Document) and then icon, which is nothing to start with. I...
3
1511
by: Keith Mills | last post by:
Hello, please find attached a basic outline of what I am attempting to accomplish... basically I want to create a number of THREADS (which I can do fine), but I then need a method for them to be able to communicate with each other, either through a message loop, or some other manner. I ALSO need to be able to CALL specific functions / subs...
2
1798
by: Prophet | last post by:
Can someone help me troubleshoot this IISSTATE log ? I have tried to make sense out of it but with no luck I am currently running IIS5 on a Win 2k box. Hosting 3 web sites and runnning asp pages. One of the asp pages (confirmations.asp) is making the dllhost.exe process hog all the cpu for a while and the underlying application (the...
15
2561
by: Jay | last post by:
I have a multi threaded VB.NET application (4 threads) that I use to send text messages to many, many employees via system.timer at a 5 second interval. Basically, I look in a SQL table (queue) to determine who needs to receive the text message then send the message to the address. Only problem is, the employee may receive up to 4 of the...
6
6856
by: Sergey Poberezovskiy | last post by:
I have the following code in C# that I have trouble converting to VB(2.0): private delegate void openDialog(); private void openWindowsDialog(openDialog open) { Thread thread = new Thread(new ThreadStart(open)); thread.SetApartmentState(ApartmentState.STA); thread.Start(); }
0
7666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7888
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7644
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7951
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6260
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1201
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.