Click here to Skip to main content
15,892,298 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralConvertion to tiff files Pin
Sergio Batarce16-Jun-04 7:49
Sergio Batarce16-Jun-04 7:49 
GeneralRe: Convertion to tiff files Pin
David Crow16-Jun-04 7:52
David Crow16-Jun-04 7:52 
Generalusing substring in VC++ Pin
swerajan16-Jun-04 7:47
swerajan16-Jun-04 7:47 
GeneralRe: using substring in VC++ Pin
David Crow16-Jun-04 7:49
David Crow16-Jun-04 7:49 
GeneralRe: using substring in VC++ Pin
swerajan16-Jun-04 8:01
swerajan16-Jun-04 8:01 
GeneralRe: using substring in VC++ Pin
David Crow16-Jun-04 8:05
David Crow16-Jun-04 8:05 
GeneralRe: using substring in VC++ Pin
toxcct16-Jun-04 9:54
toxcct16-Jun-04 9:54 
GeneralCritical Section question Pin
kfaday16-Jun-04 7:25
kfaday16-Jun-04 7:25 
Hi I'm designing a multiclient drawing board. There's a pencil. When you click (OnLButtonDown) on the pencil over an area, CPoints are added to a CPoint list(OnMouseMove), and when you release the mouse button (OnLButtonUp), a (-1,-1) is sent to the list.

I sent that, so that in the OnPaint function, LineTo's are called for every point of the list, and when you get a (-1,-1) it means that the line ends.

When you release the mouse button(OnLButtonUp), the list is sent to the other drawing board.

The problem is that while you are drawing (without release the mouse button), and the other person draws something, when he realeases the mouse button, the list is sent to the other person, and i don't want that to happen.

So i thought of CCritical Section. The drawing board, has the list of CPoints, and i wanted the board not to receive while you are drawing.

So i declared in the drawing board class:
CCriticalSection CritSect;
And in the OnLButtonDown, i call CritSect.Lock(), and in OnLButtonUp, i call CritSect.UnLock(), hoping that when you are drawing, a list wouldn't be inserted to your list when you are drawing. but that doesn't happen.

Do you have any ideas of what i'm doing wrong? perhaps the CCriticalSection approach is wrong.

thank you very much for your help!.
GeneralRe: Critical Section question Pin
Blake Miller16-Jun-04 13:27
Blake Miller16-Jun-04 13:27 
GeneralRe: Critical Section question Pin
kfaday16-Jun-04 14:31
kfaday16-Jun-04 14:31 
GeneralRe: Critical Section question Pin
Blake Miller16-Jun-04 14:41
Blake Miller16-Jun-04 14:41 
GeneralRe: Critical Section question Pin
kfaday16-Jun-04 15:35
kfaday16-Jun-04 15:35 
Generala newbie question Pin
Nelson L.16-Jun-04 6:33
Nelson L.16-Jun-04 6:33 
GeneralRe: a newbie question Pin
Rodrigo Pinto Pereira de Souza16-Jun-04 7:15
Rodrigo Pinto Pereira de Souza16-Jun-04 7:15 
GeneralRe: a newbie question Pin
Deian16-Jun-04 10:48
Deian16-Jun-04 10:48 
GeneralGetting SID of computer Pin
Bash16-Jun-04 6:27
Bash16-Jun-04 6:27 
GeneralRe: Getting SID of computer Pin
David Crow16-Jun-04 7:48
David Crow16-Jun-04 7:48 
Generalcopy file to another folder Pin
elephantstar16-Jun-04 6:24
elephantstar16-Jun-04 6:24 
GeneralRe: copy file to another folder Pin
palbano16-Jun-04 7:06
palbano16-Jun-04 7:06 
GeneralRe: copy file to another folder Pin
elephantstar16-Jun-04 10:02
elephantstar16-Jun-04 10:02 
GeneralRe: copy file to another folder Pin
David Crow16-Jun-04 7:54
David Crow16-Jun-04 7:54 
GeneralRe: copy file to another folder Pin
elephantstar16-Jun-04 10:04
elephantstar16-Jun-04 10:04 
GeneralRe: copy file to another folder Pin
Archer28216-Jun-04 19:25
Archer28216-Jun-04 19:25 
Generalconversion from 'long' to 'void *' of greater size Pin
TonidasCouves16-Jun-04 6:19
sussTonidasCouves16-Jun-04 6:19 
GeneralRe: conversion from 'long' to 'void *' of greater size Pin
bikram singh16-Jun-04 6:44
bikram singh16-Jun-04 6:44 

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.