Click here to Skip to main content
16,007,472 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralThanx Pin
16-Jan-02 7:28
suss16-Jan-02 7:28 
GeneralProblems with executing transfered files! Pin
16-Jan-02 5:10
suss16-Jan-02 5:10 
GeneralRe: Problems with executing transfered files! Pin
Carlos Antollini16-Jan-02 5:24
Carlos Antollini16-Jan-02 5:24 
GeneralRe: Problems with executing transfered files! Pin
Nish Nishant16-Jan-02 13:25
sitebuilderNish Nishant16-Jan-02 13:25 
QuestionHow to find property sheet with FindWindow Pin
16-Jan-02 4:35
suss16-Jan-02 4:35 
AnswerRe: How to find property sheet with FindWindow Pin
Joaquín M López Muñoz16-Jan-02 9:06
Joaquín M López Muñoz16-Jan-02 9:06 
GeneralRe: How to find property sheet with FindWindow Pin
Jerry Wang16-Jan-02 10:22
Jerry Wang16-Jan-02 10:22 
GeneralRe: How to find property sheet with FindWindow Pin
Joaquín M López Muñoz16-Jan-02 10:48
Joaquín M López Muñoz16-Jan-02 10:48 
Well, it is not in OnSetActive and OnKillActive (those would be useful for keeping track of the active property page), but rather on construction and destruction time. To polish things up, you can wrap it all in static methods of your class. Sort of like this: (Warning: I've not even compiled it, expect typos)
class 
CControlPanelSheet{
...
  static CControlPanelSheet* GetActiveSheet()
  {
    return theOne; // could be NULL if no active sheet exists.
  }
  static BOOL CreateSheet(...){ // ... are the construction parameters
    if(theOne)return FALSE; // there can only be one sheet at a time
    new CControlPanelSheet();
    return TRUE;
  }
...
private: // having ctor private forces user to use CreateSheet
  static CControlPanelSheet theOne; // initialized to NULL in your .cpp
  CControlPanelSheet(...)
  {
    ... // call to Create here
    theOne=this;
  }
  ~CControlPanelSheet()
  {
    theOne=NULL;
  }
  void afx_msg OnDestroy() // add message handler for this, you know
  {
    CPropertySheet::OnDestroy();
    delete this;
  }
};


Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
GeneralRe: How to find property sheet with FindWindow Pin
Jerry Wang16-Jan-02 11:00
Jerry Wang16-Jan-02 11:00 
GeneralRe: How to find property sheet with FindWindow Pin
Jerry Wang16-Jan-02 10:27
Jerry Wang16-Jan-02 10:27 
GeneralRe: How to find property sheet with FindWindow Pin
Joaquín M López Muñoz16-Jan-02 10:31
Joaquín M López Muñoz16-Jan-02 10:31 
GeneralRe: How to find property sheet with FindWindow Pin
Jerry Wang16-Jan-02 10:50
Jerry Wang16-Jan-02 10:50 
GeneralRe: How to find property sheet with FindWindow Pin
Joaquín M López Muñoz16-Jan-02 11:17
Joaquín M López Muñoz16-Jan-02 11:17 
Generaldelete Pin
Stan the man16-Jan-02 4:26
Stan the man16-Jan-02 4:26 
GeneralRe: delete Pin
Michael P Butler16-Jan-02 4:36
Michael P Butler16-Jan-02 4:36 
GeneralRe: delete Pin
Jon Sagara16-Jan-02 4:37
Jon Sagara16-Jan-02 4:37 
GeneralRe: delete Pin
Vivek Rajan16-Jan-02 4:47
Vivek Rajan16-Jan-02 4:47 
QuestionWhat to do to get rid from this error "Dll Function call crashed"? Pin
Daed16-Jan-02 4:20
Daed16-Jan-02 4:20 
AnswerRe: What to do to get rid from this error "Dll Function call crashed"? Pin
Joaquín M López Muñoz16-Jan-02 9:28
Joaquín M López Muñoz16-Jan-02 9:28 
GeneralRe: What to do to get rid from this error "Dll Function call crashed"? Pin
Daed16-Jan-02 20:58
Daed16-Jan-02 20:58 
GeneralRe: What to do to get rid from this error "Dll Function call crashed"? Pin
Joaquín M López Muñoz16-Jan-02 21:20
Joaquín M López Muñoz16-Jan-02 21:20 
GeneralRe: What to do to get rid from this error "Dll Function call crashed"? Pin
Daed16-Jan-02 21:39
Daed16-Jan-02 21:39 
GeneralRe: What to do to get rid from this error "Dll Function call crashed"? Pin
Joaquín M López Muñoz16-Jan-02 21:50
Joaquín M López Muñoz16-Jan-02 21:50 
GeneralRe: What to do to get rid from this error "Dll Function call crashed"? Pin
Daed16-Jan-02 22:24
Daed16-Jan-02 22:24 
GeneralRe: What to do to get rid from this error "Dll Function call crashed"? Pin
Joaquín M López Muñoz17-Jan-02 1:58
Joaquín M López Muñoz17-Jan-02 1:58 

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.