Click here to Skip to main content
15,916,371 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: class align vs struct align Pin
Bram van Kampen12-Aug-08 12:13
Bram van Kampen12-Aug-08 12:13 
GeneralRe: class align vs struct align Pin
oobimoo12-Aug-08 12:20
oobimoo12-Aug-08 12:20 
AnswerRe: class align vs struct align Pin
Jijo.Raj12-Aug-08 19:22
Jijo.Raj12-Aug-08 19:22 
GeneralRe: class align vs struct align Pin
oobimoo12-Aug-08 23:18
oobimoo12-Aug-08 23:18 
GeneralRe: class align vs struct align Pin
Bram van Kampen13-Aug-08 16:32
Bram van Kampen13-Aug-08 16:32 
QuestionInitializing and Terminating function calls with a static library Pin
Chris Meech12-Aug-08 10:18
Chris Meech12-Aug-08 10:18 
AnswerRe: Initializing and Terminating function calls with a static library Pin
Mark Salsbery12-Aug-08 10:45
Mark Salsbery12-Aug-08 10:45 
GeneralRe: Initializing and Terminating function calls with a static library Pin
Chris Meech12-Aug-08 15:02
Chris Meech12-Aug-08 15:02 
That's kinda of what's in use now, but it leaks because the call to CallMeLast is in the dtors. However it has to be made after the last dtor call has been completed. Similarly the call to CallMeFirst has to be made before any ctor is called. For example this code leaks at best and depending upon what SomeClass is, can crash.
{
  CallMeFirst();
...
  SomeClass   ObjectA;
...
  ObjectA.DoSomeStuff();
...
  CallMeLast();
}
This above leaks or crashes because the dtor of SomeClass is called after the CallMeLast. Whereas the following code is fine.
{
  CallMeFirst();
...
  {
    SomeClass   ObjectA;
...
    ObjectA.DoSomeStuff();
...
  }
  CallMeLast();
}

What I'm after is someway to ensure proper use of CallMeFirst and CallMeLast will happen even if someone just compiles/links to the library.

Thanks for the thoughts, Mark.

Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]

GeneralRe: Initializing and Terminating function calls with a static library Pin
Mark Salsbery12-Aug-08 15:22
Mark Salsbery12-Aug-08 15:22 
GeneralRe: Initializing and Terminating function calls with a static library Pin
Bram van Kampen12-Aug-08 15:40
Bram van Kampen12-Aug-08 15:40 
GeneralRe: Initializing and Terminating function calls with a static library Pin
Chris Meech13-Aug-08 4:29
Chris Meech13-Aug-08 4:29 
GeneralRe: Initializing and Terminating function calls with a static library Pin
Mark Salsbery13-Aug-08 6:01
Mark Salsbery13-Aug-08 6:01 
GeneralRe: Initializing and Terminating function calls with a static library Pin
Bram van Kampen12-Aug-08 15:27
Bram van Kampen12-Aug-08 15:27 
GeneralRe: Initializing and Terminating function calls with a static library Pin
Mark Salsbery12-Aug-08 15:33
Mark Salsbery12-Aug-08 15:33 
GeneralRe: Initializing and Terminating function calls with a static library Pin
Chris Meech13-Aug-08 4:31
Chris Meech13-Aug-08 4:31 
AnswerRe: Initializing and Terminating function calls with a static library Pin
Bram van Kampen12-Aug-08 15:19
Bram van Kampen12-Aug-08 15:19 
QuestionC++ pointer question Pin
winburn12-Aug-08 10:17
winburn12-Aug-08 10:17 
AnswerRe: C++ pointer question Pin
krmed12-Aug-08 10:41
krmed12-Aug-08 10:41 
GeneralRe: C++ pointer question Pin
winburn12-Aug-08 10:54
winburn12-Aug-08 10:54 
Questiondeclaring vars inside loop Pin
john john mackey12-Aug-08 8:59
john john mackey12-Aug-08 8:59 
AnswerRe: declaring vars inside loop Pin
Nemanja Trifunovic12-Aug-08 9:30
Nemanja Trifunovic12-Aug-08 9:30 
GeneralRe: declaring vars inside loop Pin
Bram van Kampen12-Aug-08 12:19
Bram van Kampen12-Aug-08 12:19 
GeneralRe: declaring vars inside loop Pin
Nemanja Trifunovic12-Aug-08 13:19
Nemanja Trifunovic12-Aug-08 13:19 
GeneralRe: declaring vars inside loop Pin
Bram van Kampen12-Aug-08 16:01
Bram van Kampen12-Aug-08 16:01 
GeneralRe: declaring vars inside loop Pin
Randor 12-Aug-08 13:47
professional Randor 12-Aug-08 13:47 

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.