Re: CRITICAL_SECTION not initialized globally in DllMain

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



What is the point of declaring a static variable if it's already global. Does static global not mean it's valid only in the context of the same source file ?

//Daniel


"Fabian" <Fabian@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:267FE375-2B69-40BE-BF83-BEFBDD8CCAB0@xxxxxxxxxxxxxxxx
My CRITICAL_SECTION object is declared in a header file as follows:

static CRITICAL_SECTION csCalibrate;



.



Relevant Pages

  • Re: Compiler cant see class
    ... from Code Project with the same predicatable results in that I didn't ... I've also tried declaring the class object in ... Think of the compiler as reading each source file from top to bottom. ... It must encounter the #include that declares the class before it encounters any use of the class. ...
    (microsoft.public.vc.language)
  • Re: calling my custom function same as library function
    ... > According to the C standard, it is neither portable nor acceptable to ... > use the name of a library function in a context where it has external ... > name from within the same source file. ...
    (comp.lang.c)
  • Re: CRITICAL_SECTION not initialized globally in DllMain
    ... declaring variables in header files is a bad idea. ... In this case, the same header file being included in multiple compilation units causes multiple declarations of the same variable; unless, as when you specified static, the declarations are local scope to the compilation unit. ... > It means each source file gets it's *own* copy of the variable. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: What is the difference between: my $var = 1 vs. my ( $var ) = 1?
    ... In the first case, the context is scalar, which results in the element ... of lvalues (assignables) and then moves the data from corresponding ... using or not using parenthesis can be context ... just declaring a normal variable, as in your example where you assign ...
    (perl.beginners)
  • Re: a basic doubt on static functions...
    ... shiva wrote: ... >I have aa basic doubt about declaring function as static. ... static for functions changes the visibility of the function. ... even if the function resides in another source file. ...
    (comp.os.linux.development.system)