Click here to Skip to main content
15,922,145 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CComboBox Pin
Dave Bryant15-Jun-03 17:39
Dave Bryant15-Jun-03 17:39 
GeneralRe: CComboBox Pin
gucy15-Jun-03 19:58
gucy15-Jun-03 19:58 
GeneralRe: CComboBox Pin
Dave Bryant16-Jun-03 10:15
Dave Bryant16-Jun-03 10:15 
Question#including headers within headers ? Pin
Anonymous15-Jun-03 17:26
Anonymous15-Jun-03 17:26 
AnswerRe: #including headers within headers ? Pin
Dave Bryant15-Jun-03 17:36
Dave Bryant15-Jun-03 17:36 
AnswerRe: #including headers within headers ? Pin
Neville Franks15-Jun-03 23:27
Neville Franks15-Jun-03 23:27 
GeneralRe: headers within headers Thanks and some more Pin
Anonymous16-Jun-03 12:37
Anonymous16-Jun-03 12:37 
GeneralRe: headers within headers Thanks and some more Pin
Neville Franks16-Jun-03 12:59
Neville Franks16-Jun-03 12:59 
Anonymous wrote:
Cheers, Thanks and Superb to both of you.

It is a pleasant change to get a thankyou - thanks for that.


Anonymous wrote:
// AnimatedSpriteClass.h
// Doesn't the statement
CTimer* pSpriteTimer; 
// require the TimerClass header to create a pointer to one ?
// No: because it is not initialised ?


No is correct. You would include:
class CTimer;


in the .h before the class definition. You need to ensure that you don't define any functions in this .h that call CTimer functions, otherwise you are back to needing CTimer.h In other words write this functions in the .cpp. If you need inline functions for speed then put them in a .inl.


Anonymous wrote:
// AnimatedSpriteClass.cpp
// Then when I define the InitSprite(int x, int y, int CurrentAnimSequence);
// do I initialize the Ctimer pointer to an instance of the CTimer ?
pSpriteTimer = new CTimer;
// will that do the trick ?


Yes. But I'd suggest doing this in the AnimatedSpriteClass constructor and the delete pSpriteTimer; in the destructor. Better still using either an STL auto_ptr or Boost scoped_ptr. eg. In the .h

boost::scoped_ptr<CTimer> pSpriteTimer;

and in the constructor:

pSpriteTimer.reset( new CTimer );


Then you don't need to delete pSpriteTimer and can rest assured that it will be cleaned up if an exception occures etc.

Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
GeneralPlease help: MSDEV and the demo files Pin
UlrichGeMX15-Jun-03 15:32
UlrichGeMX15-Jun-03 15:32 
GeneralRe: Please help: MSDEV and the demo files Pin
Richard Jones16-Jun-03 3:03
Richard Jones16-Jun-03 3:03 
GeneralRe: Please help: MSDEV and the demo files Pin
UlrichGeMX16-Jun-03 3:22
UlrichGeMX16-Jun-03 3:22 
Generaloffice automation using OLE Pin
chennailu15-Jun-03 15:09
susschennailu15-Jun-03 15:09 
GeneralPrevent ALT F4 Pin
Søren Alsbjerg Hørup15-Jun-03 13:33
Søren Alsbjerg Hørup15-Jun-03 13:33 
GeneralRe: Prevent ALT F4 Pin
Harsha Gopal15-Jun-03 15:27
Harsha Gopal15-Jun-03 15:27 
GeneralRe: Prevent ALT F4 Pin
Anonymous15-Jun-03 17:34
Anonymous15-Jun-03 17:34 
GeneralRe: Prevent ALT F4 Pin
Ryan Binns15-Jun-03 17:50
Ryan Binns15-Jun-03 17:50 
GeneralRe: Prevent ALT F4 Pin
Joan M16-Jun-03 0:48
professionalJoan M16-Jun-03 0:48 
GeneralRe: Prevent ALT F4 Pin
Ryan Binns16-Jun-03 1:01
Ryan Binns16-Jun-03 1:01 
GeneralCouple of questions concerning bits Pin
georgiek5015-Jun-03 11:27
georgiek5015-Jun-03 11:27 
GeneralRe: Couple of questions concerning bits Pin
adamUK15-Jun-03 11:52
adamUK15-Jun-03 11:52 
GeneralRe: Couple of questions concerning bits Pin
Toni7815-Jun-03 12:07
Toni7815-Jun-03 12:07 
GeneralRe: Couple of questions concerning bits Pin
georgiek5015-Jun-03 12:58
georgiek5015-Jun-03 12:58 
GeneralRe: Couple of questions concerning bits Pin
Harsha Gopal15-Jun-03 15:42
Harsha Gopal15-Jun-03 15:42 
GeneralRe: Couple of questions concerning bits Pin
georgiek5015-Jun-03 15:53
georgiek5015-Jun-03 15:53 
GeneralRe: Couple of questions concerning bits Pin
peterchen15-Jun-03 23:49
peterchen15-Jun-03 23:49 

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.