|
thx for the quick rpl!
I did type casting!!
The compiler agrees on that!
But is it really safe!!! It should not break at run-time.
Also how much byte does LONG takeS??
thx!!
|
|
|
|
|
LONG is 4 bytes.
time_t is now a 64-bit value (unless _USE_32BIT_TIME_T is defined).
"A winner is not one who never fails...but the one who never quits"
|
|
|
|
|
i defined _USE_32BIT_TIME_T in the header file at the top!!
I rebuild the solution.
Still its showing time_t as type int_64 and size 8 bytes.
where am I going wrong!
|
|
|
|
|
sach!! wrote: Also how much byte does LONG takeS??
write this to know :
std::cout << "sizeof(LONG) = " << sizeof(LONG) << endl;
|
|
|
|
|
Thx
That is what i am doing to get the size!!
I need to use 32bit time_t so i declered
#define _USE_32BIT_TIME_T
But its not making any diffence!! I am still getting 8 bytes as a size of time_t var.
|
|
|
|
|
sach!! wrote: But its not making any diffence!! I am still getting 8 bytes as a size of time_t var.
typecast it to FILETIME ! it length is 64 bit!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
sach!! wrote: am having problem coverting a time_t varible into LONG data type.
my Question is WHY?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
hi alok!!
I am porting code from VC6 to VC8.
I have many other function which r taking LONg as a parameter. If I can convert the time_t to LONG, that will save time n efforts to change all those function. Thats why!
thx
|
|
|
|
|
time_t is defined as __int64 by default!!
How safe it is to declear var with __int32 instead of time_t so that i can get a 32 bit time.
|
|
|
|
|
Hi,
I need to pass an array from a DLL to a static lib function in order to be filled (the DLL links against the static lib). Neither lib supports MFC.
Something like:
int* intArray=new int(3);
CallStaticAPI(intArray);//the API will just put 3 ints in the array
//do some processing with the array
delete intArray;
When I try to delete the array, the program crashes. I looked in dbgheap.c and the message I get is :"If this ASSERT fails, a bad pointer has been passed in. It may be totally bogus, or it may have been allocated from another heap. The pointer MUST come from the 'local' heap".
The pointer is definitelly good because I can read from it.
Any suggestions?
thanx
|
|
|
|
|
kozu wrote: int* intArray=new int(3);
Here you are assigning intArray to be a pointer to a single int that has a value of three, What you want is
int *intArray = new int[3]; You are getting the assertion because when you put 3 ints into the array (which has the size of one) you are generating a buffer overrun.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
thanks PJ! I'm such a schmuck...
|
|
|
|
|
By default in winCE DrawText API wrap text on hyphen. If any one knows the equivalent API that does not wrap text on hyphen, Please let me know.
|
|
|
|
|
anilksingh wrote: By default in winCE DrawText API wrap text on hyphen.
if there is enough space then also will it get wrapped?
In the DrawText funtion give the DT_WORDBREAK|DT_EDITCONTROL and dont give the DT_SINGLELINE style.
nave
|
|
|
|
|
Hi,
Thanks but DT_EDITCONTROL is not supported by winCE.
|
|
|
|
|
Hi all,
i am writing Two Events LButton Click and LButton Double Click Events, I want to Execute Separate Events for Both.
1) In LButton Click i want to draw an Ellipse.
2) In LButton Double Click i want to Show a Dialog.
But, When i Double Click the View i am able to Perform Two Operations.
it mean i am drawing in the View and Showing the Dialog.
But my Requirement is OnDoubleClick the View i want to Show the Dialog. and when i click a Single Click i want to Draw a Circle.
Please help me out.
Uday kiran
|
|
|
|
|
|
hi whitesky,
I have written two events one is LButtonClick and the Other is LButtonDoubleClick event in CView Class.
my Requirement is In the LButtonClick i want to Draw a Circle,
and in LButtonDoubleClick i want to Dispaly a Dialog.
My Observations:
when i Double Click i am Drawing a Cirle and as well as Displaying the Dialog.
I want to Display only the Dialog not to Draw the Circle when Double Click event.
how can i approach for this.
please help me out.
Uday kiran
|
|
|
|
|
When a single click comes, set a timer with the time greater than the mouse double click speed time. When a mouse double click comes, Kill the timer u set earlier and show the dialog u want.
in the timer handler, First kill the timer and then draw the ellipse.
Hope u understand...?
nave
|
|
|
|
|
hi nave,
please give me a snippet of code so that i will be very greatfull towards u.
i always rember you. its an urgent requiremnt.
Uday kiran
|
|
|
|
|
void CTranspDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
int nTime = GetDoubleClickTime();
SetTimer( 1, nTime , 0 );
CDialog::OnLButtonDown(nFlags, point);
}
void CTranspDlg::OnLButtonDblClk(UINT nFlags, CPoint point)
{
KillTimer( 1 );
// show ur dialog here
CDialog::OnLButtonDblClk(nFlags, point);
}
void CTranspDlg::OnTimer(UINT nIDEvent)
{
if( nIDEvent == 1 )
{
KillTimer( nIDEvent );
// draw ur ellipse here
}
CDialog::OnTimer(nIDEvent);
}
nave
|
|
|
|
|
hai nave,
thanku very much i got it.
Uday kiran
|
|
|
|
|
Hi friends
I am developing a application " pseudo event generation " and i am facing problem in generating event message(desciption). I am using a resouce DLL for it. but i am not able to map the messages for eventID and Category.
Like if eventId is 100 and category is NONE then mesage will be different when eventId is 100 and category is Disk/printer/services etc.
if anybody had done it before then plz help me
vickz
|
|
|
|
|
Hi,
I have created a control type variable for an edit box.My requirement is if I enter anything other than a number , it should display a message.Is there any function available to check whether the entered data is a number or not?(As per my requirement the variable should be only control type but not an integer or double type)
Thanks in advance
Sandhya
|
|
|
|
|
derive a class from the CEdit and overide the WM_CHAR message. In that function u can chek the entered character is number or not.
nave
|
|
|
|