Click here to Skip to main content
16,017,788 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: log10 ( 3/2 ) = 0.000 Help me! :( [modified] Solved Pin
Christian Graus2-Jun-07 21:55
protectorChristian Graus2-Jun-07 21:55 
Questionmanaged/unmanaged code Pin
includeh102-Jun-07 6:09
includeh102-Jun-07 6:09 
AnswerRe: managed/unmanaged code Pin
Sathesh Sakthivel2-Jun-07 7:39
Sathesh Sakthivel2-Jun-07 7:39 
AnswerRe: managed/unmanaged code Pin
Mark Salsbery4-Jun-07 6:19
Mark Salsbery4-Jun-07 6:19 
Questionquestion about function InterlockedIncrement() Pin
includeh102-Jun-07 5:50
includeh102-Jun-07 5:50 
AnswerRe: question about function InterlockedIncrement() Pin
Mark Salsbery2-Jun-07 6:00
Mark Salsbery2-Jun-07 6:00 
AnswerRe: question about function InterlockedIncrement() Pin
toxcct2-Jun-07 6:02
toxcct2-Jun-07 6:02 
Generalnot really Pin
includeh102-Jun-07 7:04
includeh102-Jun-07 7:04 
my test code is as following:
the thread has been created for 5 times by CreateThread(), so I have 5 threads:

//---------- code

long i_Lock=0;
long i_Thread=0;

int WINAPI ZDlg::Thread_Simple(void*pv)
{
if(i_Thread==0)
{
::InterlockedIncrement(&i_Lock);
}
else
{
i_Lock++;
}

i_Thread++;

int iNum=0;
while(iNum<5)
{
iNum++;

Sleep(1000);
}
return 0;
}

//--------------------
so only first thread calls InterlockedIncrement(&i_Lock);
and other 4 call i_Lock++;

if i_Lock is really locked, its value must be 1.
but when I test the value in while() loops, it is 5.
so i_Lock++ works and i_Lock is not locked!

is something wrong?
GeneralRe: not really Pin
Mark Salsbery2-Jun-07 8:16
Mark Salsbery2-Jun-07 8:16 
GeneralRe: not really Pin
includeh102-Jun-07 16:47
includeh102-Jun-07 16:47 
GeneralRe: not really Pin
Mark Salsbery3-Jun-07 9:07
Mark Salsbery3-Jun-07 9:07 
QuestionFatal Error Pin
mahesh.mundackal2-Jun-07 2:55
mahesh.mundackal2-Jun-07 2:55 
QuestionRe: Fatal Error Pin
Rajesh R Subramanian2-Jun-07 3:18
professionalRajesh R Subramanian2-Jun-07 3:18 
AnswerRe: Fatal Error Pin
S Douglas2-Jun-07 19:49
professionalS Douglas2-Jun-07 19:49 
AnswerRe: Fatal Error Pin
Hamid_RT2-Jun-07 20:31
Hamid_RT2-Jun-07 20:31 
QuestionAligning Toolbars Pin
Anurag Gandhi2-Jun-07 2:23
professionalAnurag Gandhi2-Jun-07 2:23 
QuestionProblem in Inserting ActiveX Control in SDI Pin
S_Murali2-Jun-07 2:03
S_Murali2-Jun-07 2:03 
GeneralRe: Problem in Inserting ActiveX Control in SDI Pin
Rajesh R Subramanian2-Jun-07 2:09
professionalRajesh R Subramanian2-Jun-07 2:09 
GeneralRe: Problem in Inserting ActiveX Control in SDI Pin
S_Murali2-Jun-07 2:32
S_Murali2-Jun-07 2:32 
JokeRe: Problem in Inserting ActiveX Control in SDI Pin
Hamid_RT2-Jun-07 20:28
Hamid_RT2-Jun-07 20:28 
QuestionRe: Problem in Inserting ActiveX Control in SDI Pin
Hamid_RT2-Jun-07 20:27
Hamid_RT2-Jun-07 20:27 
QuestionException! Pin
kcynic2-Jun-07 1:05
kcynic2-Jun-07 1:05 
GeneralRe: Exception! Pin
Rajesh R Subramanian2-Jun-07 1:11
professionalRajesh R Subramanian2-Jun-07 1:11 
GeneralRe: Exception! Pin
kcynic2-Jun-07 1:27
kcynic2-Jun-07 1:27 
GeneralRe: Exception! Pin
Rajesh R Subramanian2-Jun-07 1:33
professionalRajesh R Subramanian2-Jun-07 1:33 

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.