Click here to Skip to main content
15,912,504 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMenu Item Text Pin
20-Jun-02 5:14
suss20-Jun-02 5:14 
GeneralRe: Menu Item Text Pin
20-Jun-02 5:30
suss20-Jun-02 5:30 
GeneralRe: Menu Item Text Pin
Brian Delahunty20-Jun-02 6:13
Brian Delahunty20-Jun-02 6:13 
QuestionHow do i delete a record set??? Pin
TommyKnocker20-Jun-02 4:51
TommyKnocker20-Jun-02 4:51 
AnswerRe: How do i delete a record set??? Pin
Chad Koehler20-Jun-02 5:00
Chad Koehler20-Jun-02 5:00 
QuestionCan't i use two dimensional arrays with the new keyword? Pin
redeemer20-Jun-02 4:44
redeemer20-Jun-02 4:44 
AnswerRe: Can't i use two dimensional arrays with the new keyword? Pin
Chris Losinger20-Jun-02 4:54
professionalChris Losinger20-Jun-02 4:54 
AnswerRe: Can't i use two dimensional arrays with the new keyword? Pin
Joaquín M López Muñoz20-Jun-02 6:46
Joaquín M López Muñoz20-Jun-02 6:46 
The reason is that vertres must be a compile-time constant. Eg. the following would work:
int horzres = GetDeviceCaps(GetDC(GetDesktopWindow()), HORZRES);
const int vertres = 600;
COLORREF (*pCol)[vertres] = new COLORREF[horzres][vertres];
But of course this is not what you want. Solutions:
  1. Follow Chris' advice and construct an array of arrays. This complicates the destruction code, though.
  2. Use a one-dimensional array and index it like follows:
    COLORREF *pCol = new COLORREF[horzres*vertres];
    pCol[h*vertres+v]; // eq. to pCol[h][v]
  3. Use a std::vector<std::vector<COLORREF> >.The construction code is as complicated as in 1, but at least you get automatic cleanup.


Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
GeneralRe: Can't i use two dimensional arrays with the new keyword? Pin
redeemer20-Jun-02 8:44
redeemer20-Jun-02 8:44 
QuestionWhy an ID in CreateThread()? Pin
20-Jun-02 4:38
suss20-Jun-02 4:38 
AnswerRe: Why an ID in CreateThread()? Pin
redeemer20-Jun-02 4:51
redeemer20-Jun-02 4:51 
GeneralRe: Why an ID in CreateThread()? Pin
20-Jun-02 5:25
suss20-Jun-02 5:25 
AnswerRe: Why an ID in CreateThread()? Pin
20-Jun-02 6:55
suss20-Jun-02 6:55 
AnswerRe: Why an ID in CreateThread()? Pin
Joaquín M López Muñoz20-Jun-02 6:57
Joaquín M López Muñoz20-Jun-02 6:57 
GeneralRe: Why an ID in CreateThread()? Pin
moliate20-Jun-02 20:58
moliate20-Jun-02 20:58 
AnswerRe: Why an ID in CreateThread()? Pin
moliate20-Jun-02 20:42
moliate20-Jun-02 20:42 
GeneralProblem with loading resources at runtime Pin
Dean Goodman20-Jun-02 4:29
Dean Goodman20-Jun-02 4:29 
GeneralRe: Problem with loading resources at runtime Pin
Navin20-Jun-02 4:33
Navin20-Jun-02 4:33 
GeneralRe: Problem with loading resources at runtime Pin
Dean Goodman20-Jun-02 4:44
Dean Goodman20-Jun-02 4:44 
GeneralRe: Problem with loading resources at runtime Pin
-Dy21-Jun-02 4:10
-Dy21-Jun-02 4:10 
GeneralRe: Problem with loading resources at runtime Pin
Atlantys21-Jun-02 12:48
Atlantys21-Jun-02 12:48 
GeneralOutlook Add-in Pin
20-Jun-02 4:16
suss20-Jun-02 4:16 
QuestionHow do i get the vertical and horizontal resolution of the screen? Pin
redeemer20-Jun-02 4:03
redeemer20-Jun-02 4:03 
AnswerRe: How do i get the vertical and horizontal resolution of the screen? Pin
Chris Losinger20-Jun-02 4:19
professionalChris Losinger20-Jun-02 4:19 
AnswerRe: How do i get the vertical and horizontal resolution of the screen? Pin
Niklas L20-Jun-02 4:19
Niklas L20-Jun-02 4:19 

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.