Click here to Skip to main content
16,005,037 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: Wierd Errors Pin
Nish Nishant30-Nov-05 8:38
sitebuilderNish Nishant30-Nov-05 8:38 
Questionvolatile variable without volatile!!!!!!!!!!!!!!!!! Pin
Pegasus Kiddo28-Nov-05 23:53
Pegasus Kiddo28-Nov-05 23:53 
AnswerRe: volatile variable without volatile!!!!!!!!!!!!!!!!! Pin
toxcct29-Nov-05 0:39
toxcct29-Nov-05 0:39 
GeneralRe: volatile variable without volatile!!!!!!!!!!!!!!!!! Pin
Pegasus Kiddo29-Nov-05 0:53
Pegasus Kiddo29-Nov-05 0:53 
GeneralRe: volatile variable without volatile!!!!!!!!!!!!!!!!! Pin
hariharasuthan29-Nov-05 1:20
hariharasuthan29-Nov-05 1:20 
GeneralRe: volatile variable without volatile!!!!!!!!!!!!!!!!! Pin
toxcct29-Nov-05 2:02
toxcct29-Nov-05 2:02 
GeneralRe: volatile variable without volatile!!!!!!!!!!!!!!!!! Pin
toxcct29-Nov-05 2:06
toxcct29-Nov-05 2:06 
GeneralRe: volatile variable without volatile!!!!!!!!!!!!!!!!! Pin
S. Senthil Kumar4-Dec-05 2:55
S. Senthil Kumar4-Dec-05 2:55 
toxcct wrote:
do you see any point in the C++ language that allow you to perform such an action rounding over the volatile keyword ? no.


Actually yes. When you use a thread and you're sharing a variable, for instance.
class A
{
   static bool bFlag;

   void MethodA()
   {
      AfxBeginThread(&methodB,...);
      Thread.Sleep(1000);
      bFlag = false;
   }
   static UINT MethodB(LPVOID param)
   {
       //Some synchronization mechanism
       while (!bflag)
       {
           ...
       }
   }
}


might not work as expected, because the compiler can optimize away the while loop condition. The volatile keyword prevents that from happening.

Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
AnswerRe: volatile variable without volatile!!!!!!!!!!!!!!!!! Pin
Jörgen Sigvardsson2-Dec-05 15:01
Jörgen Sigvardsson2-Dec-05 15:01 
QuestionDLL export function should wait for a flag set from WndProc - OnDeviceCahnge. How?? Pin
kk_vp28-Nov-05 21:36
kk_vp28-Nov-05 21:36 
AnswerRe: DLL export function should wait for a flag set from WndProc - OnDeviceCahnge. How?? Pin
hariharasuthan29-Nov-05 1:24
hariharasuthan29-Nov-05 1:24 
GeneralRe: DLL export function should wait for a flag set from WndProc - OnDeviceCahnge. How?? Pin
kk_vp29-Nov-05 2:07
kk_vp29-Nov-05 2:07 
QuestionGrabbing the Class from DLL Pin
Bobamagoo28-Nov-05 21:20
Bobamagoo28-Nov-05 21:20 
AnswerRe: Grabbing the Class from DLL Pin
Nish Nishant29-Nov-05 0:18
sitebuilderNish Nishant29-Nov-05 0:18 
GeneralRe: Grabbing the Class from DLL Pin
Bobamagoo29-Nov-05 1:00
Bobamagoo29-Nov-05 1:00 
Question[Interview Question ] Difference between C++ Structure and Class Pin
sudeesht28-Nov-05 20:32
sudeesht28-Nov-05 20:32 
AnswerRe: [Interview Question ] Difference between C++ Structure and Class Pin
toxcct28-Nov-05 21:34
toxcct28-Nov-05 21:34 
QuestionPassing Managed Code from DLLs Pin
Bobamagoo28-Nov-05 12:22
Bobamagoo28-Nov-05 12:22 
AnswerRe: Passing Managed Code from DLLs Pin
Nish Nishant28-Nov-05 13:33
sitebuilderNish Nishant28-Nov-05 13:33 
GeneralRe: Passing Managed Code from DLLs Pin
Bobamagoo28-Nov-05 13:43
Bobamagoo28-Nov-05 13:43 
GeneralRe: Passing Managed Code from DLLs Pin
Nish Nishant28-Nov-05 14:36
sitebuilderNish Nishant28-Nov-05 14:36 
GeneralRe: Passing Managed Code from DLLs Pin
Bobamagoo28-Nov-05 15:14
Bobamagoo28-Nov-05 15:14 
QuestionStrange VS Behavior Pin
Saksida Bojan28-Nov-05 10:09
Saksida Bojan28-Nov-05 10:09 
AnswerRe: Strange VS Behavior Pin
Nish Nishant28-Nov-05 11:04
sitebuilderNish Nishant28-Nov-05 11:04 
QuestionFixed toolbars in SDI app Pin
RoyceF27-Nov-05 17:40
RoyceF27-Nov-05 17:40 

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.