Click here to Skip to main content
15,916,288 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: what are the differences among try...catch,__try...__except and try...finally? Pin
kcynic8-Mar-08 22:01
kcynic8-Mar-08 22:01 
GeneralRe: what are the differences among try...catch,__try...__except and try...finally? Pin
Mircea Puiu8-Mar-08 22:15
Mircea Puiu8-Mar-08 22:15 
GeneralRe: what are the differences among try...catch,__try...__except and try...finally? Pin
kcynic8-Mar-08 22:28
kcynic8-Mar-08 22:28 
GeneralRe: what are the differences among try...catch,__try...__except and try...finally? Pin
Rajkumar R9-Mar-08 3:47
Rajkumar R9-Mar-08 3:47 
GeneralRe: what are the differences among try...catch,__try...__except and try...finally? Pin
kcynic9-Mar-08 14:57
kcynic9-Mar-08 14:57 
AnswerRe: what are the differences among try...catch,__try...__except and try...finally? Pin
Rajkumar R9-Mar-08 21:33
Rajkumar R9-Mar-08 21:33 
GeneralRe: what are the differences among try...catch,__try...__except and try...finally? Pin
kcynic9-Mar-08 21:36
kcynic9-Mar-08 21:36 
QuestionMultithread and GDI Issues Pin
kanduripavan8-Mar-08 18:03
kanduripavan8-Mar-08 18:03 
Hi,
I like to draw lines with delay but using threads. The data will be fetched from different list (m_lstpoints). they have to be drawn simultaneously. When i tried to do this i am getting illegal.
I am very much new to threads. Can u help me.
//Code
CRITICAL_SECTION g_csGDILock; //Initialized
AfxBeginThread(DrawStrokesUsingThrd, (LPVOID)pTInfo1);
AfxBeginThread(DrawStrokesUsingThrd, (LPVOID)pTInfo2);
AfxBeginThread(DrawStrokesUsingThrd, (LPVOID)pTInfo3);//This list
is dynamic

//The pTInfo contains the g_csGDILock pointer and other info
//to draw points such as dc and list of points.

void CPlotPoints::TDrawPoints(HDC hdc, PRTL_CRITICAL_SECTION pMutex){//Non static

POSITION pos =NULL;
CPoint pt1, pt2;
pos =m_lstPoints.GetHeadPosition();
pt1=(CPoint) m_lstPoints.GetNext(pos);
while (pos){
EnterCriticalSection(pMutex);
{

pt2=(CPoint) m_lstPoints.GetNext(pos);

CDC dc; //hdc is a CClientDC
dc.Attach(hdc);//I had even tried to Send CClientDC* directly
//Plot code begins
//Here we draw rectangles,lines or something using dc
//dc.Moveto(pt1); //These lines are giving assertion
//Plot code ends here
dc.Detach();
GdiFlush();
}
LeaveCriticalSection(pMutex);
Sleep(300);
}

}

Thank you.
Manu
GeneralRe: Multithread and GDI Issues Pin
rp_suman8-Mar-08 21:53
rp_suman8-Mar-08 21:53 
GeneralRe: Multithread and GDI Issues Pin
Cedric Moonen8-Mar-08 23:09
Cedric Moonen8-Mar-08 23:09 
GeneralRe: Multithread and GDI Issues Pin
kanduripavan9-Mar-08 2:26
kanduripavan9-Mar-08 2:26 
GeneralRe: Multithread and GDI Issues Pin
Cedric Moonen9-Mar-08 2:34
Cedric Moonen9-Mar-08 2:34 
GeneralRe: Multithread and GDI Issues Pin
kanduripavan9-Mar-08 2:49
kanduripavan9-Mar-08 2:49 
GeneralRe: Multithread and GDI Issues Pin
kanduripavan10-Mar-08 0:08
kanduripavan10-Mar-08 0:08 
GeneralRe: Multithread and GDI Issues Pin
Rajkumar R10-Mar-08 0:46
Rajkumar R10-Mar-08 0:46 
GeneralRe: Multithread and GDI Issues Pin
Mark Salsbery9-Mar-08 8:58
Mark Salsbery9-Mar-08 8:58 
GeneralRe: Multithread and GDI Issues Pin
kanduripavan10-Mar-08 0:18
kanduripavan10-Mar-08 0:18 
GeneralRe: Multithread and GDI Issues Pin
Mark Salsbery10-Mar-08 6:52
Mark Salsbery10-Mar-08 6:52 
GeneralRe: Multithread and GDI Issues Pin
Mark Salsbery10-Mar-08 6:55
Mark Salsbery10-Mar-08 6:55 
GeneralRe: Multithread and GDI Issues Pin
kanduripavan11-Mar-08 8:12
kanduripavan11-Mar-08 8:12 
QuestionHow can I get the mouse position when i click on the CListCtrl? Pin
Md. Ali Naser Khan8-Mar-08 18:00
Md. Ali Naser Khan8-Mar-08 18:00 
AnswerRe: How can I get the mouse position when i click on the CListCtrl? Pin
Md. Ali Naser Khan8-Mar-08 19:48
Md. Ali Naser Khan8-Mar-08 19:48 
GeneralRe: How can I get the mouse position when i click on the CListCtrl? Pin
Rajkumar R8-Mar-08 21:28
Rajkumar R8-Mar-08 21:28 
GeneralCSpinButton event handling Pin
Tom Paronis8-Mar-08 10:16
Tom Paronis8-Mar-08 10:16 
GeneralRe: CSpinButton event handling Pin
Mark Salsbery8-Mar-08 10:21
Mark Salsbery8-Mar-08 10:21 

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.