Click here to Skip to main content
16,014,860 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to send a 'string' to a port ? Pin
AprNgp28-Aug-08 19:29
AprNgp28-Aug-08 19:29 
GeneralRe: How to send a 'string' to a port ? Pin
AprNgp28-Aug-08 19:35
AprNgp28-Aug-08 19:35 
GeneralRe: How to send a 'string' to a port ? Pin
Rajesh R Subramanian28-Aug-08 19:48
professionalRajesh R Subramanian28-Aug-08 19:48 
QuestionCreateThread Function question Pin
monsieur_jj28-Aug-08 16:16
monsieur_jj28-Aug-08 16:16 
AnswerRe: CreateThread Function question Pin
Jijo.Raj28-Aug-08 18:15
Jijo.Raj28-Aug-08 18:15 
GeneralRe: CreateThread Function question Pin
monsieur_jj28-Aug-08 20:07
monsieur_jj28-Aug-08 20:07 
QuestionRe: CreateThread Function question Pin
Mark Salsbery29-Aug-08 8:59
Mark Salsbery29-Aug-08 8:59 
AnswerRe: CreateThread Function question Pin
monsieur_jj31-Aug-08 16:23
monsieur_jj31-Aug-08 16:23 
Hi Mark,

Here is the deal
if (isUpdateTime())
{
RMproduct* MPoint = new RMproduct(L"ManagePoint",ManagepointService, ManagepointVersion);
				if (isPrdInstalled(MPoint))
				{
					GetVersion(MPoint);
					MPoint->m_SiteCode = m_CSiteCode.GetMPSiteCode(MPoint->m_SerialNo.c_str());
					dloadAvailable = DoCheckForProductUpdates(MPoint);
					if(dloadAvailable)
					{
					GetUpdate(MPoint);
					}
				}
				delete MPoint;
RMproduct* MPoint2 = new RMproduct(L"ManagePoint",ManagepointService, ManagepointVersion);
				if (isPrdInstalled(MPoint2))
				{
					GetVersion(MPoint2);
					MPoint2->m_SiteCode = m_CSiteCode.GetMPSiteCode(MPoint2->m_SerialNo.c_str());
					dloadAvailable = DoCheckForProductUpdates(MPoint2);
					if(dloadAvailable)
					{
					GetUpdate(MPoint)2;
					}
				}
				delete MPoint;
RMproduct* MPoint3 = new RMproduct(L"ManagePoint",ManagepointService, ManagepointVersion);
				if (isPrdInstalled(MPoint))
				{
					GetVersion(MPoint3);
					MPoint3->m_SiteCode = m_CSiteCode.GetMPSiteCode(MPoint3->m_SerialNo.c_str());
					dloadAvailable = DoCheckForProductUpdates(MPoint3);
					if(dloadAvailable)
					{
					GetUpdate(MPoint3);
					}
				}
				delete MPoint3;
}
<pre>

The GetUpdate function calls the function DownloadFile(): 
<pre>
bool CUpdateServiceModule::DownloadFile(RMUpdates* prd)
{
	bool result = false;


	int Data_Of_Thread_1 = 1;            // Data of Thread 1
	HANDLE Handle_Of_Thread_1 = 0;       // variable to hold handle of Thread 1
	HANDLE Array_Of_Thread_Handles[1];   // Aray to store thread handles

	Handle_Of_Thread_1 = CreateThread( NULL, 0, Thread_no_1, ((void*)prd), 0, NULL);  
				if ( Handle_Of_Thread_1 == NULL)  ExitProcess(Data_Of_Thread_1);


	Array_Of_Thread_Handles[0] = Handle_Of_Thread_1;

	// Wait until all threads have terminated.
	WaitForMultipleObjects( 1, Array_Of_Thread_Handles, TRUE, INFINITE);

    CloseHandle(Handle_Of_Thread_1);

	//DownloadThread((void*)prd);
	Sleep( 100 );
	return result;
}


Thing is MPoint2 and MPoint3 are not sure to exist if they dont the code will only download one update if they exist it may download 2 or 3 updates. But for sure one exists. How must I create a thread in this type of event?

Thanks,
Jayjay
GeneralRe: CreateThread Function question Pin
Mark Salsbery1-Sep-08 7:35
Mark Salsbery1-Sep-08 7:35 
GeneralRe: CreateThread Function question Pin
monsieur_jj1-Sep-08 14:17
monsieur_jj1-Sep-08 14:17 
QuestionHtmlHelp v x64 Pin
Chris Losinger28-Aug-08 14:12
professionalChris Losinger28-Aug-08 14:12 
Questionproblem with RegEnumValue to read the values in the registry.. Pin
hariakuthota28-Aug-08 12:23
hariakuthota28-Aug-08 12:23 
QuestionRe: problem with RegEnumValue to read the values in the registry.. Pin
David Crow28-Aug-08 15:36
David Crow28-Aug-08 15:36 
AnswerRe: problem with RegEnumValue to read the values in the registry.. Pin
Jijo.Raj28-Aug-08 18:24
Jijo.Raj28-Aug-08 18:24 
AnswerRe: problem with RegEnumValue to read the values in the registry.. Pin
krmed29-Aug-08 0:48
krmed29-Aug-08 0:48 
QuestionHow to have use different version resources for different configurations Pin
Wheatbread28-Aug-08 6:06
Wheatbread28-Aug-08 6:06 
AnswerRe: How to have use different version resources for different configurations Pin
enhzflep28-Aug-08 7:29
enhzflep28-Aug-08 7:29 
AnswerRe: How to have use different version resources for different configurations Pin
Michael Dunn29-Aug-08 13:12
sitebuilderMichael Dunn29-Aug-08 13:12 
Questionactivex - internet exploret has blocked my site because of an unsafe manner Pin
simon alec smith28-Aug-08 5:13
simon alec smith28-Aug-08 5:13 
Questionhow to override start button? Pin
dj440028-Aug-08 3:51
dj440028-Aug-08 3:51 
AnswerRe: how to override start button? Pin
Perspx28-Aug-08 4:01
Perspx28-Aug-08 4:01 
AnswerRe: how to override start button? Pin
sashoalm28-Aug-08 5:19
sashoalm28-Aug-08 5:19 
GeneralRe: how to override start button? Pin
dj44003-Sep-08 22:33
dj44003-Sep-08 22:33 
GeneralRe: how to override start button? Pin
sashoalm5-Sep-08 1:06
sashoalm5-Sep-08 1:06 
QuestionRead and write binary Pin
The ANZAC28-Aug-08 3:14
The ANZAC28-Aug-08 3:14 

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.