Click here to Skip to main content
15,917,862 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: STACKS AND QUES Pin
Jim Crafton15-Apr-04 10:17
Jim Crafton15-Apr-04 10:17 
GeneralMaskededit control Pin
C++NewBe15-Apr-04 7:49
C++NewBe15-Apr-04 7:49 
GeneralRe: Maskededit control Pin
David Crow15-Apr-04 10:14
David Crow15-Apr-04 10:14 
GeneralRe: Maskededit control Pin
C++NewBe15-Apr-04 10:19
C++NewBe15-Apr-04 10:19 
GeneralRe: Maskededit control Pin
David Crow15-Apr-04 10:33
David Crow15-Apr-04 10:33 
GeneralRe: Maskededit control Pin
C++NewBe15-Apr-04 10:42
C++NewBe15-Apr-04 10:42 
GeneralSerialize Pin
Demian Panello15-Apr-04 5:48
Demian Panello15-Apr-04 5:48 
GeneralMulti threading Pin
dreamerzz15-Apr-04 5:13
dreamerzz15-Apr-04 5:13 
Hi,

Currently i am working on single document interface MFC to create a small update program to the database to change the values store in the fields.

However, in order to let the program run "automatically", i have to used thread. But I know nuts about threading.

I have attached the main part of the updating of the program below. pls kindly help..I have read up on books about C++ on the thread function. the book says, to create and start, i have to use AfxBeginThread and have some arguements inside. and a function UINT MyThreadFunction(LPVOID pParam).

Really need help on this as its very urgent to me... Thanks a million.

<br />
void CUpdateView::OnUpdatedb() <br />
{<br />
	// TODO: Add your control notification handler code here<br />
<br />
	double propa_update = 0.814;<br />
	double resp_update = 0.205;<br />
	double link_update = 1.19;<br />
<br />
	//get a pointer to the recordset<br />
	CUpdateDoc* pDoc = GetDocument();<br />
	UseRecordset* pUseRecordset	= &pDoc->m_UseRecordset;<br />
<br />
	do<br />
	{<br />
		//Allows the current record to be edited<br />
		pUseRecordset->Edit();<br />
			<br />
		//increment in the values from the database<br />
		pUseRecordset->m_propatime = pUseRecordset->m_propatime*propa_update;<br />
		pUseRecordset->m_respondtime = pUseRecordset->m_respondtime*resp_update;<br />
		pUseRecordset->m_link = pUseRecordset->m_link*link_update;<br />
		<br />
		//Saves the current changes to the database<br />
		pUseRecordset->Update();<br />
<br />
		//Reruns the current SQL query to refresh the recordset<br />
		pUseRecordset->Requery();<br />
<br />
		//Update the form<br />
		UpdateData(true);<br />
	}while(check_exit!=0);<br />
}<br />
<br />
void CUpdateView::OnExit() <br />
{<br />
	check_exit=0;<br />
	OnExit();<br />
}

GeneralRe: Multi threading Pin
David Crow15-Apr-04 7:16
David Crow15-Apr-04 7:16 
GeneralRe: Multi threading Pin
dreamerzz15-Apr-04 20:38
dreamerzz15-Apr-04 20:38 
GeneralRe: Multi threading Pin
David Crow19-Apr-04 2:28
David Crow19-Apr-04 2:28 
GeneralRe: Multi threading Pin
dreamerzz20-Apr-04 2:14
dreamerzz20-Apr-04 2:14 
QuestionVisual Basic-like editor for VC++ 6.0? Pin
AAntix15-Apr-04 4:55
AAntix15-Apr-04 4:55 
AnswerRe: Visual Basic-like editor for VC++ 6.0? Pin
toxcct15-Apr-04 6:54
toxcct15-Apr-04 6:54 
GeneralRe: Visual Basic-like editor for VC++ 6.0? Pin
David Crow15-Apr-04 7:13
David Crow15-Apr-04 7:13 
GeneralRe: Visual Basic-like editor for VC++ 6.0? Pin
AAntix15-Apr-04 7:21
AAntix15-Apr-04 7:21 
AnswerRe: Visual Basic-like editor for VC++ 6.0? Pin
Prakash Nadar15-Apr-04 17:55
Prakash Nadar15-Apr-04 17:55 
QuestionPlug-in to read HTML page for IE? Pin
Pauwll15-Apr-04 4:41
Pauwll15-Apr-04 4:41 
Generalvoid main Pin
dreamerzz15-Apr-04 4:38
dreamerzz15-Apr-04 4:38 
GeneralRe: void main Pin
jmkhael15-Apr-04 4:55
jmkhael15-Apr-04 4:55 
GeneralRe: void main Pin
dreamerzz15-Apr-04 5:17
dreamerzz15-Apr-04 5:17 
GeneralRe: void main Pin
jmkhael15-Apr-04 5:25
jmkhael15-Apr-04 5:25 
GeneralRe: void main Pin
dreamerzz15-Apr-04 5:30
dreamerzz15-Apr-04 5:30 
GeneralRe: void main Pin
David Crow15-Apr-04 7:11
David Crow15-Apr-04 7:11 
GeneralRe: void main Pin
basementman15-Apr-04 5:29
basementman15-Apr-04 5:29 

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.