Click here to Skip to main content
16,005,149 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: "Please enter no more than 256 characters." Pin
Nish Nishant22-Feb-03 3:56
sitebuilderNish Nishant22-Feb-03 3:56 
GeneralRe: "Please enter no more than 256 characters." Pin
Vladimir Georgiev22-Feb-03 4:58
Vladimir Georgiev22-Feb-03 4:58 
GeneralRe: "Please enter no more than 256 characters." Pin
Nish Nishant22-Feb-03 5:55
sitebuilderNish Nishant22-Feb-03 5:55 
GeneralRe: "Please enter no more than 256 characters." Pin
Vladimir Georgiev22-Feb-03 7:42
Vladimir Georgiev22-Feb-03 7:42 
GeneralRe: "Please enter no more than 256 characters." Pin
Mike Nordell22-Feb-03 8:22
Mike Nordell22-Feb-03 8:22 
GeneralRe: "Please enter no more than 256 characters." Pin
Anonymous22-Feb-03 10:44
Anonymous22-Feb-03 10:44 
GeneralRe: "Please enter no more than 256 characters." Pin
Nish Nishant22-Feb-03 9:11
sitebuilderNish Nishant22-Feb-03 9:11 
GeneralSemaphores and Mutexes Pin
almc22-Feb-03 1:20
almc22-Feb-03 1:20 
Hi there!

I'm having some trouble using mutexes, and since a mutex is a semaphore with only one resource, my frist idea was to use it, but it seems that or the mutex is not well implemented or i am using it in a bad manner...

For instance, if i use the following code:
<br />
CSemaphore s1(1,1,"S1")<br />
if (s1.Lock(500))<br />
{<br />
    CSemaphore s2(1,1,"S1");<br />
    if (s2.Lock(500))<br />
    {<br />
        TRACE("\n Semaphore failed!");<br />
    }<br />
<br />
    s1.Unlock(1);<br />
}<br />


... i never get to see the trace message in the display! But, if use:

<br />
CMutex m1(TRUE,"M1")<br />
if (m1.Lock(500))<br />
{<br />
    CMutex m2(TRUE,"M1");<br />
    if (m2.Lock(500))<br />
    {<br />
        TRACE("\n Mutex failed!");<br />
    }<br />
<br />
    m1.Unlock(1);<br />
}<br />


I Always see the trace message... even if i change the initial ownership of the mutex.

Can anyone, please, show me the right way to do it with mutexes?
Thanx for your time!
GeneralRe: Semaphores and Mutexes Pin
Mike Nordell22-Feb-03 8:31
Mike Nordell22-Feb-03 8:31 
GeneralRe: Semaphores and Mutexes Pin
Jambolo22-Feb-03 20:37
Jambolo22-Feb-03 20:37 
GeneralMultiple View Pin
ROK_RShadow22-Feb-03 0:06
ROK_RShadow22-Feb-03 0:06 
GeneralRe: Multiple View Pin
ROK_RShadow22-Feb-03 1:16
ROK_RShadow22-Feb-03 1:16 
GeneralRe: Multiple View Pin
MAAK22-Feb-03 12:17
MAAK22-Feb-03 12:17 
GeneralMemory Leakage !!!! Pin
Chintan21-Feb-03 23:03
Chintan21-Feb-03 23:03 
GeneralRe: Memory Leakage !!!! Pin
RobJones25-Feb-03 10:18
RobJones25-Feb-03 10:18 
Generallimiting the size of a CDialog Pin
nss21-Feb-03 22:19
nss21-Feb-03 22:19 
GeneralRe: limiting the size of a CDialog Pin
Stephane Rodriguez.21-Feb-03 22:56
Stephane Rodriguez.21-Feb-03 22:56 
GeneralRe: limiting the size of a CDialog Pin
nss21-Feb-03 23:28
nss21-Feb-03 23:28 
GeneralRe: limiting the size of a CDialog Pin
Stephane Rodriguez.22-Feb-03 0:38
Stephane Rodriguez.22-Feb-03 0:38 
GeneralRe: limiting the size of a CDialog Pin
Michael Dunn22-Feb-03 7:51
sitebuilderMichael Dunn22-Feb-03 7:51 
Questionwhat's font do u use when u programing? Pin
ttzzgg_8071321-Feb-03 21:45
ttzzgg_8071321-Feb-03 21:45 
AnswerRe: what's font do u use when u programing? Pin
Jambolo22-Feb-03 20:42
Jambolo22-Feb-03 20:42 
GeneralWindows Messages Pin
ROK_RShadow21-Feb-03 20:28
ROK_RShadow21-Feb-03 20:28 
GeneralRe: Windows Messages Pin
MAAK21-Feb-03 21:46
MAAK21-Feb-03 21:46 
GeneralRe: Windows Messages Pin
ROK_RShadow21-Feb-03 23:58
ROK_RShadow21-Feb-03 23:58 

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.