|
gggwb wrote: but everytime the server application will disappear after connect success
What do you mean disappear ? Does it crahes ? If yes, use your debugger to locate the problem and fix it.
If no, then explain the problem more clearly.
|
|
|
|
|
to Cedric Moonen
is the server application window disappear
|
|
|
|
|
Window is disappearing means some kind of exception is there. So debug and locate it.
Come online at:-
jubinc@skype
|
|
|
|
|
It's the 3rd time you say that... You've been told to debug the application to see what happens because it is probably a crash of the application. So, did you do it ?
|
|
|
|
|
of course,I have did it,but I still cant't find the reason,perhaps my level is too low..
OU!my God!Who can help me~!
|
|
|
|
|
So, where does it crashes ? What is the error message ? Did you check your variables to see if everything is correct just before the crash ?
gggwb wrote: Who can help me
If you don''t give any information, we certainly can't.
|
|
|
|
|
gggwb wrote: OU!
Hey, another Oklahoma fan. Go Sooners!
"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
|
|
|
|
|
DavidCrow wrote: Hey, another Oklahoma fan.
Or Kyle has strayed out of the Soapbox again.
led mike
|
|
|
|
|
Cedric Moonen wrote: So, did you do it ?
Indeed he did. And the debugger reported:
Unhandled exception at 0x00413641 of application.exe: 0xC0000005:
the server application window disappeared
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Please make sure there is no curse cast on your software
|
|
|
|
|
Ehm... I'm quite sure there is, actually...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
CPallini wrote: 0xC0000005
That is an access violation. Did you renew your passport in time?
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
I was about to remove or mangle the number, but, after a quick look at the forum, I said to myself: "Don't worry buddy, Luc isn't around... "
My bad!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
I'm always lurking around, and access violations don't go unnoticed.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Hello,
I'm banging my head on a problem that I first though will be easy to solve.
I have a date contained in a COleDateTime object and I would like to 'increment' it. For example, I would like to add one month, or two days, or 3 years, ... This is will always be one single component of the date (second, minute, hour, day, month or year) but this could overflow.
Suppose my date is 31 November 2007 and I would like to add two months to it, the result should be 31 January 2008.
I know that I can use the COleDateTimeSpan class but it only supports Days, hours and seconds, not months and years . And I really don't want to calculate the number of days that correspond to a month increase (being too variable).
Does anybody know how I can solve the problem ? Maybe by manipulating the wrapped DATE object (which correspond to a double) but I don't know exactly how to do that.
|
|
|
|
|
Well, the tricky part is the month addition, since for seconds, minutes, hours, days you can indeed use COleDateTimeSpan objects.
I suggest a dirty but simple workaround: call GetMonth (and GetYear , and...) on the COleDateTime object, add the amount of months required, handle overflow (it is a simple matter of month%12; and year+=month/12; , you know... ) and use SetDate (or SetDateTime ) method to obtain the final result.
Adding years is similar though much simpler.
I know is ugly hybrid design, but using directly the raw double value don't free you froma making the daunting number of days calculation.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Yes, that's right. I didn't think about that (sometimes you are just too concentrated on one part of your problem and fail to see other paths). One little annoying thing is that, when I change the year or month I'll need to "set back" the day, hour, minute and second parts. But that's a small price to pay for a working solution
Thanks !
|
|
|
|
|
You know, you're welcome.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Cedric Moonen wrote: Suppose my date is 31 November 2007 and I would like to add two months to it..
The problem is that a month does not have a constant value.
Also, suppose you wanted to add three months to the date. Since February does not have 31 days, do you stop at February 28, or go 3 days into March? If the latter, it looks odd since March would then be four months away.
"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
|
|
|
|
|
DavidCrow wrote: The problem is that a month does not have a constant value.
Yes I know and that's what complicate my problem .
DavidCrow wrote: Also, suppose you wanted to add three months to the date. Since February does not have 31 days, do you stop at February 28, or go 3 days into March? If the latter, it looks odd since March would then be four months away.
Well, I see now that my example was very badly chosen. In fact, when I increment a date by a certain amount of months, it will always start at the 1st of the month (so, November 1st + 3 months = February 1st).
But CPallini's answer is the way to go I suppose (didn't implement it yet).
|
|
|
|
|
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
|
|
|
|
|
Hello everyone,
I need to know the wide character (unicode) and multibyte (UTF-8) values of a character string of czech. I personally know nothing about czech. Is the following approach correct?
1. I use L on the character string and watch memory to get the wide character representation of the character string in little endian form;
2. I change the computer region/language to czech, and use function WideCharToMultiByte, and use CP_ACP as input code page and use the L character string as input to get the output multibyte character string output from parameter lpMultiByteStr.
Is (1) and (2) correct? Any more efficient and smart ways?
thanks in advance,
George
|
|
|
|
|
try this
wcstombs function.
i think this will help you.
|
|
|
|
|
Hi Nitheesh,
Is this function relates to my question? I think I am using almost the same approach. Could you describe the steps to get wide character and multibyte value for a given czech character string please?
regards,
George
|
|
|
|
|
Who gives you a czech string?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|