Click here to Skip to main content
16,008,183 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Help CList or? I'm lost. Pin
Jay Beckert9-Oct-01 15:25
Jay Beckert9-Oct-01 15:25 
GeneralRe: Help CList or? I'm lost. Pin
Christian Graus9-Oct-01 15:37
protectorChristian Graus9-Oct-01 15:37 
QuestionProperty list like visual studio?? Pin
mhowes2-Oct-01 12:31
mhowes2-Oct-01 12:31 
AnswerRe: Property list like visual studio?? Pin
Bret Faller2-Oct-01 13:21
Bret Faller2-Oct-01 13:21 
GeneralConstructors and (...) Pin
Sprudling2-Oct-01 11:39
Sprudling2-Oct-01 11:39 
GeneralRe: Constructors and (...) Pin
Tomasz Sowinski2-Oct-01 11:59
Tomasz Sowinski2-Oct-01 11:59 
GeneralRe: Constructors and (...) Pin
Sprudling2-Oct-01 12:58
Sprudling2-Oct-01 12:58 
GeneralRe: Constructors and (...) Pin
Tomasz Sowinski2-Oct-01 23:36
Tomasz Sowinski2-Oct-01 23:36 
I mean that you should allocate raw memory for all objects first using ::operator new or malloc. Constructors are not called in this phase. You use placement new next to initialize objects in allocated memory. The only problem left is that different classes you're going to put into ObArray may need different number of constructor parameters - you can solve this by providing multiple ObArray constructors, each having different number of params. Assuming that there are max 3 parameters that you need to pass, declaration of ObArray should begin like this:
template <typename T, 
typename P1 = void, 
typename P2 = void,
typename P3 = void>
class ObArray
{
// four constructors should go here
// one accepting only number of objects and no params
// and one for 1,2,3 params
};

Of course, you can generalize this to use more than 3 parameters in the c'tor.


Tomasz Sowinski -- http://www.shooltz.com
GeneralConvert Integer to LPSTR Pin
2-Oct-01 11:14
suss2-Oct-01 11:14 
GeneralRe: Convert Integer to LPSTR Pin
Carlos Antollini2-Oct-01 11:41
Carlos Antollini2-Oct-01 11:41 
GeneralThank you! Pin
2-Oct-01 11:59
suss2-Oct-01 11:59 
QuestionIs it even possible to create a multiline CListCtrl in report mode? Pin
DanYELL2-Oct-01 11:11
DanYELL2-Oct-01 11:11 
AnswerRe: Is it even possible to create a multiline CListCtrl in report mode? Pin
Bret Faller2-Oct-01 13:20
Bret Faller2-Oct-01 13:20 
GeneralRe: Is it even possible to create a multiline CListCtrl in report mode? Pin
DanYELL3-Oct-01 3:29
DanYELL3-Oct-01 3:29 
GeneralHere's a stumper - 'fixing' text selection Pin
Jason Hihn2-Oct-01 11:03
Jason Hihn2-Oct-01 11:03 
Generalread a single line from textfile Pin
2-Oct-01 9:47
suss2-Oct-01 9:47 
GeneralRe: read a single line from textfile Pin
Chris Losinger2-Oct-01 9:49
professionalChris Losinger2-Oct-01 9:49 
GeneralThanks!! Pin
2-Oct-01 10:02
suss2-Oct-01 10:02 
GeneralRe: read a single line from textfile Pin
Peter Molnar2-Oct-01 10:45
Peter Molnar2-Oct-01 10:45 
GeneralOutput window of Visual C++ Pin
Peter Molnar2-Oct-01 9:28
Peter Molnar2-Oct-01 9:28 
GeneralRe: Output window of Visual C++ Pin
Carlos Antollini2-Oct-01 9:30
Carlos Antollini2-Oct-01 9:30 
GeneralCreate Dll in VC++ for client that works in Delphi Pin
2-Oct-01 9:13
suss2-Oct-01 9:13 
GeneralRe: Create Dll in VC++ for client that works in Delphi Pin
Chris Losinger2-Oct-01 9:48
professionalChris Losinger2-Oct-01 9:48 
GeneralRe: Create Dll in VC++ for client that works in Delphi Pin
Tim Deveaux2-Oct-01 9:52
Tim Deveaux2-Oct-01 9:52 
GeneralThank you !! Pin
2-Oct-01 11:09
suss2-Oct-01 11:09 

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.