Click here to Skip to main content
15,878,543 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: the winsock problem Pin
Luc Pattyn24-Jan-08 3:45
sitebuilderLuc Pattyn24-Jan-08 3:45 
GeneralManipulating COleDateTime objects Pin
Cedric Moonen23-Jan-08 21:35
Cedric Moonen23-Jan-08 21:35 
GeneralRe: Manipulating COleDateTime objects Pin
CPallini23-Jan-08 22:06
mveCPallini23-Jan-08 22:06 
GeneralRe: Manipulating COleDateTime objects Pin
Cedric Moonen23-Jan-08 22:16
Cedric Moonen23-Jan-08 22:16 
GeneralRe: Manipulating COleDateTime objects Pin
CPallini23-Jan-08 22:35
mveCPallini23-Jan-08 22:35 
GeneralRe: Manipulating COleDateTime objects Pin
David Crow24-Jan-08 3:12
David Crow24-Jan-08 3:12 
GeneralRe: Manipulating COleDateTime objects Pin
Cedric Moonen24-Jan-08 3:29
Cedric Moonen24-Jan-08 3:29 
GeneralRe: Manipulating COleDateTime objects Pin
David Crow24-Jan-08 5:24
David Crow24-Jan-08 5:24 
Cedric Moonen wrote:
But CPallini's answer is the way to go I suppose (didn't implement it yet).


It looks to be a viable solution:

COleDateTime AddMonths( const COleDateTime dt, const int nMonthsToAdd )
{
    COleDateTime    dateTemp;
    int             nMonth = (dt.GetMonth() - 1) + nMonthsToAdd,
                    nYear  = dt.GetYear(),                    
                    x = 0;
 
    dateTemp.SetStatus(COleDateTime::invalid);
 
    while (dateTemp.GetStatus() == COleDateTime::invalid && x < 4)
    {
        dateTemp.SetDateTime(nYear + (nMonth / 12), 
                             (nMonth % 12) + 1, 
                             dt.GetDay() - x, 
                             dt.GetHour(),
                             dt.GetMinute(),
                             dt.GetSecond());
 
        x++;
    }
 
    return dateTemp;
}


"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne


Generalget wide character and multibyte character value Pin
George_George23-Jan-08 20:10
George_George23-Jan-08 20:10 
GeneralRe: get wide character and multibyte character value Pin
Nitheesh George23-Jan-08 22:49
Nitheesh George23-Jan-08 22:49 
GeneralRe: get wide character and multibyte character value Pin
George_George23-Jan-08 23:28
George_George23-Jan-08 23:28 
JokeRe: get wide character and multibyte character value Pin
CPallini23-Jan-08 23:34
mveCPallini23-Jan-08 23:34 
GeneralRe: get wide character and multibyte character value Pin
George_George24-Jan-08 1:31
George_George24-Jan-08 1:31 
QuestionRe: get wide character and multibyte character value Pin
CPallini24-Jan-08 1:47
mveCPallini24-Jan-08 1:47 
GeneralRe: get wide character and multibyte character value Pin
George_George24-Jan-08 2:00
George_George24-Jan-08 2:00 
GeneralRe: get wide character and multibyte character value Pin
CPallini24-Jan-08 2:19
mveCPallini24-Jan-08 2:19 
GeneralRe: get wide character and multibyte character value Pin
George_George24-Jan-08 14:19
George_George24-Jan-08 14:19 
GeneralRe: get wide character and multibyte character value Pin
CPallini24-Jan-08 21:03
mveCPallini24-Jan-08 21:03 
GeneralRe: get wide character and multibyte character value Pin
George_George24-Jan-08 21:23
George_George24-Jan-08 21:23 
GeneralRe: get wide character and multibyte character value Pin
CPallini24-Jan-08 21:27
mveCPallini24-Jan-08 21:27 
GeneralRe: get wide character and multibyte character value Pin
George_George24-Jan-08 21:47
George_George24-Jan-08 21:47 
GeneralRe: get wide character and multibyte character value Pin
CPallini24-Jan-08 21:54
mveCPallini24-Jan-08 21:54 
GeneralRe: get wide character and multibyte character value Pin
George_George24-Jan-08 22:27
George_George24-Jan-08 22:27 
GeneralRe: get wide character and multibyte character value Pin
Nemanja Trifunovic24-Jan-08 15:46
Nemanja Trifunovic24-Jan-08 15:46 
GeneralRe: get wide character and multibyte character value Pin
George_George24-Jan-08 16:36
George_George24-Jan-08 16:36 

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.