Click here to Skip to main content
15,888,113 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMSADO15.tlh file not available in ..c:\documents and settings\user\local settings\temp\msado15.tlh Pin
pandit843-Apr-09 4:05
pandit843-Apr-09 4:05 
Questiondynamic 2D array template for non-built-in types. [modified] Pin
Sauce!3-Apr-09 2:36
Sauce!3-Apr-09 2:36 
AnswerRe: dynamic 2D array template for non-built-in types. Pin
Stuart Dootson3-Apr-09 2:58
professionalStuart Dootson3-Apr-09 2:58 
GeneralRe: dynamic 2D array template for non-built-in types. [modified] Pin
Sauce!3-Apr-09 4:13
Sauce!3-Apr-09 4:13 
GeneralRe: dynamic 2D array template for non-built-in types. Pin
Stuart Dootson3-Apr-09 6:48
professionalStuart Dootson3-Apr-09 6:48 
GeneralRe: dynamic 2D array template for non-built-in types. [modified] Pin
Sauce!3-Apr-09 20:19
Sauce!3-Apr-09 20:19 
GeneralRe: dynamic 2D array template for non-built-in types. Pin
Stuart Dootson4-Apr-09 2:43
professionalStuart Dootson4-Apr-09 2:43 
GeneralRe: dynamic 2D array template for non-built-in types. Pin
Sauce!4-Apr-09 5:32
Sauce!4-Apr-09 5:32 
The reason I've done it this way is because Array2D (not in my test project here, but in the project it was intended for) is used as a member variable for a user-defined class. Array2D expects a width and height as arguments to the constructor. Consider:

class someclass
{
public:
     someclass();
     ~someclass();

private:
     Array2D<int> *myArray;
};

someclass::someclass(UINT width, UINT height)
{
     myArray = new Array2D<int>(width, height);
}

someclass::~someclass()
{
     delete myArray;
}


alternatively...

class someclass
{
public:
     someclass(UINT width, UINT height):myArray<int>(width)(height);
     ~someclass();

private:
     Array2D<int> myArray;
};

someclass::~someclass()
{

}


I'm really not a fan of the second snippet. It just comes down to preference really. Unfortunately that means I have to pay the price and place brackets around the dereference operator to override operator precedence like so; (*myArray)[x][y]
AnswerRe: dynamic 2D array template for non-built-in types. Pin
Maximilien3-Apr-09 3:00
Maximilien3-Apr-09 3:00 
AnswerRe: dynamic 2D array template for non-built-in types. Pin
Iain Clarke, Warrior Programmer4-Apr-09 0:06
Iain Clarke, Warrior Programmer4-Apr-09 0:06 
GeneralRe: dynamic 2D array template for non-built-in types. Pin
Sauce!4-Apr-09 0:19
Sauce!4-Apr-09 0:19 
QuestionHow do i create an Executable (.exe) to debug my project? Pin
blokkies3-Apr-09 2:13
blokkies3-Apr-09 2:13 
AnswerRe: How do i create an Executable (.exe) to debug my project? Pin
Rajesh R Subramanian3-Apr-09 2:29
professionalRajesh R Subramanian3-Apr-09 2:29 
GeneralRe: How do i create an Executable (.exe) to debug my project? Pin
blokkies3-Apr-09 2:43
blokkies3-Apr-09 2:43 
GeneralRe: How do i create an Executable (.exe) to debug my project? Pin
Rajesh R Subramanian3-Apr-09 3:20
professionalRajesh R Subramanian3-Apr-09 3:20 
GeneralRe: How do i create an Executable (.exe) to debug my project? Pin
blokkies3-Apr-09 3:40
blokkies3-Apr-09 3:40 
GeneralRe: How do i create an Executable (.exe) to debug my project? Pin
Cedric Moonen3-Apr-09 3:52
Cedric Moonen3-Apr-09 3:52 
GeneralRe: How do i create an Executable (.exe) to debug my project? Pin
blokkies3-Apr-09 4:03
blokkies3-Apr-09 4:03 
QuestionRe: How do i create an Executable (.exe) to debug my project? Pin
David Crow3-Apr-09 4:13
David Crow3-Apr-09 4:13 
AnswerRe: How do i create an Executable (.exe) to debug my project? Pin
blokkies3-Apr-09 4:20
blokkies3-Apr-09 4:20 
GeneralRe: How do i create an Executable (.exe) to debug my project? Pin
David Crow3-Apr-09 4:23
David Crow3-Apr-09 4:23 
GeneralRe: How do i create an Executable (.exe) to debug my project? Pin
Cedric Moonen3-Apr-09 4:17
Cedric Moonen3-Apr-09 4:17 
GeneralRe: How do i create an Executable (.exe) to debug my project? Pin
blokkies3-Apr-09 4:32
blokkies3-Apr-09 4:32 
GeneralRe: How do i create an Executable (.exe) to debug my project? Pin
blokkies3-Apr-09 4:59
blokkies3-Apr-09 4:59 
QuestionRe: How do i create an Executable (.exe) to debug my project? Pin
David Crow3-Apr-09 6:31
David Crow3-Apr-09 6:31 

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.