Click here to Skip to main content
15,915,768 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: RGB differences Windows 2000 vs XP Pin
_AnsHUMAN_ 6-Aug-08 1:39
_AnsHUMAN_ 6-Aug-08 1:39 
GeneralRe: RGB differences Windows 2000 vs XP Pin
kildareflare6-Aug-08 2:21
kildareflare6-Aug-08 2:21 
GeneralRe: RGB differences Windows 2000 vs XP Pin
kildareflare6-Aug-08 4:08
kildareflare6-Aug-08 4:08 
QuestionVC7 libs on VC8 Pin
vikramlinux6-Aug-08 0:54
vikramlinux6-Aug-08 0:54 
AnswerRe: VC7 libs on VC8 Pin
Chris Losinger6-Aug-08 13:35
professionalChris Losinger6-Aug-08 13:35 
QuestionCritical section failed! Pin
SRKSHOME6-Aug-08 0:29
SRKSHOME6-Aug-08 0:29 
AnswerRe: Critical section failed! Pin
SandipG 6-Aug-08 0:37
SandipG 6-Aug-08 0:37 
GeneralRe: Critical section failed! Pin
SRKSHOME6-Aug-08 1:30
SRKSHOME6-Aug-08 1:30 
here it goes.this is my critical section class. Whenever I want critical section I will just create object of this class and call request() and release() functions to lock and unlock.It is giving me run time exception in the destructor of this class. When executing this destructor(DeleteCritical section) it is saying critical sectio not initialised.

class DSCriticalSection
{
public:

DSCriticalSection()
: m_nLockCount(0)
{
InitializeCriticalSection(&_section );
}
~DSCriticalSection()
{
DeleteCriticalSection( &_section );
}

inline void Request() const
{
EnterCriticalSection( &_section );
::InterlockedIncrement(&m_nLockCount);


}

inline void Release() const
{
if (::InterlockedExchange(&m_nLockCount, m_nLockCount) > 0)
{
::InterlockedDecrement(&m_nLockCount);
LeaveCriticalSection( &_section );
}
}

inline long GetLockCount() const
{
return m_nLockCount;
}

private:
mutable CRITICAL_SECTION _section;
mutable long m_nLockCount;
};
GeneralRe: Critical section failed! Pin
SandipG 6-Aug-08 1:36
SandipG 6-Aug-08 1:36 
QuestionHow to change a single toolbar icon at runtime? Pin
madmax00015-Aug-08 23:54
madmax00015-Aug-08 23:54 
AnswerRe: How to change a single toolbar icon at runtime? Pin
Sarath C6-Aug-08 0:12
Sarath C6-Aug-08 0:12 
Questionmerge proxy/stub code in ATL server Pin
George_George5-Aug-08 23:46
George_George5-Aug-08 23:46 
QuestionRe: merge proxy/stub code in ATL server Pin
led mike6-Aug-08 4:32
led mike6-Aug-08 4:32 
AnswerRe: merge proxy/stub code in ATL server Pin
George_George6-Aug-08 19:40
George_George6-Aug-08 19:40 
GeneralRe: merge proxy/stub code in ATL server Pin
led mike7-Aug-08 7:13
led mike7-Aug-08 7:13 
GeneralRe: merge proxy/stub code in ATL server Pin
George_George8-Aug-08 23:30
George_George8-Aug-08 23:30 
QuestionHow to loop through a directory Pin
santhoshv845-Aug-08 23:40
santhoshv845-Aug-08 23:40 
AnswerRe: How to loop through a directory Pin
_AnsHUMAN_ 6-Aug-08 0:02
_AnsHUMAN_ 6-Aug-08 0:02 
AnswerRe: How to loop through a directory Pin
Sarath C6-Aug-08 0:06
Sarath C6-Aug-08 0:06 
GeneralRe: How to loop through a directory Pin
Sarath C6-Aug-08 0:10
Sarath C6-Aug-08 0:10 
AnswerRe: How to loop through a directory Pin
Jijo.Raj6-Aug-08 0:09
Jijo.Raj6-Aug-08 0:09 
JokeRe: How to loop through a directory [modified] Pin
SandipG 6-Aug-08 0:11
SandipG 6-Aug-08 0:11 
JokeRe: How to loop through a directory Pin
Jijo.Raj6-Aug-08 0:14
Jijo.Raj6-Aug-08 0:14 
GeneralRe: How to loop through a directory Pin
Jijo.Raj6-Aug-08 1:01
Jijo.Raj6-Aug-08 1:01 
QuestionRe: How to loop through a directory Pin
David Crow6-Aug-08 7:20
David Crow6-Aug-08 7:20 

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.