Click here to Skip to main content
15,917,808 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralType Cast! Pin
hph29-Apr-02 5:45
hph29-Apr-02 5:45 
GeneralRe: Type Cast! Pin
Jeremy Falcon29-Apr-02 6:00
professionalJeremy Falcon29-Apr-02 6:00 
GeneralRe: Type Cast! Pin
Le centriste29-Apr-02 6:47
Le centriste29-Apr-02 6:47 
GeneralRe: Type Cast! Pin
Nish Nishant29-Apr-02 7:00
sitebuilderNish Nishant29-Apr-02 7:00 
Generalone more static variable initializtion question Pin
Jack Hui29-Apr-02 5:43
Jack Hui29-Apr-02 5:43 
GeneralRe: one more static variable initializtion question Pin
Albert Pascual29-Apr-02 6:00
sitebuilderAlbert Pascual29-Apr-02 6:00 
GeneralRe: one more static variable initializtion question Pin
Tim Smith29-Apr-02 10:35
Tim Smith29-Apr-02 10:35 
GeneralRe: one more static variable initializtion question Pin
Joaquín M López Muñoz29-Apr-02 9:47
Joaquín M López Muñoz29-Apr-02 9:47 
Unlike Java, there's no facility in C++ for static construction/destruction. One can make it up nevertheless as this example shows:
//my_class.h
 
class myclass
{
public:
  static CRITICAL_SECTION cs;
private:
  friend my_class::static_initializer;
  struct static_initializer
  {
    static_initializer();
    ~static_initializer();
  };
  static static_initializer si;
};
 
// my_class.cpp
 
CRITICAL_SECTION my_class::cs;
 
my_class::static_initializer::static_initializer()
{
  InitializeCriticalSection(my_class::cs);
}
 
my_class::static_initializer::~static_initializer()
{
  DeleteCriticalSection(my_class::cs);
}
 
my_class::static_initializer my_class::si;


Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
GeneralRe: one more static variable initializtion question Pin
Michael Dunn29-Apr-02 14:51
sitebuilderMichael Dunn29-Apr-02 14:51 
Generalneed help in VC++.NET Pin
geagle29-Apr-02 5:34
geagle29-Apr-02 5:34 
GeneralGroup Box caption problem Pin
moobob29-Apr-02 5:25
moobob29-Apr-02 5:25 
GeneralRe: Group Box caption problem Pin
l a u r e n29-Apr-02 6:24
l a u r e n29-Apr-02 6:24 
GeneralRe: Group Box caption problem Pin
moobob29-Apr-02 6:41
moobob29-Apr-02 6:41 
Generalreduce exe size Pin
Hesham Amin29-Apr-02 4:11
Hesham Amin29-Apr-02 4:11 
GeneralRe: reduce exe size Pin
Mike Zinni29-Apr-02 5:23
Mike Zinni29-Apr-02 5:23 
GeneralRe: reduce exe size Pin
Albert Pascual29-Apr-02 6:01
sitebuilderAlbert Pascual29-Apr-02 6:01 
GeneralRe: reduce exe size Pin
Tim Deveaux29-Apr-02 9:09
Tim Deveaux29-Apr-02 9:09 
GeneralRe: reduce exe size Pin
Michael Dunn29-Apr-02 14:52
sitebuilderMichael Dunn29-Apr-02 14:52 
GeneralRe: reduce exe size Pin
Nish Nishant29-Apr-02 15:17
sitebuilderNish Nishant29-Apr-02 15:17 
GeneralRe: reduce exe size Pin
Michael Dunn29-Apr-02 17:44
sitebuilderMichael Dunn29-Apr-02 17:44 
GeneralRe: reduce exe size Pin
Hesham Amin29-Apr-02 23:01
Hesham Amin29-Apr-02 23:01 
GeneralALT + F4 Pin
bishbosh0229-Apr-02 4:01
bishbosh0229-Apr-02 4:01 
GeneralRe: ALT + F4 Pin
Stan the man29-Apr-02 5:15
Stan the man29-Apr-02 5:15 
GeneralRe: ALT + F4 Pin
Shog929-Apr-02 5:59
sitebuilderShog929-Apr-02 5:59 
GeneralRe: ALT + F4 Pin
bishbosh0229-Apr-02 22:24
bishbosh0229-Apr-02 22:24 

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.