|
Dear All,
Thanks for your immediately response. I download the demo and I looked into the MSDN. Could you please advice me where I made the mistake? I attach the I have written. I take an error that CDatabase does not exit or undeclared variable.
Thanks for your time.
Best Regards,
Konstantinos.
void CIsup_semi_1Dlg::OnOK()
{
// TODO: Add extra validation here
CDatabase database; //error
CString testing,final_bytes[1000];
int bytes,final_decimal[1000],cbyte,counter=0;
char buffer[50];
unsigned short hbyte,lbyte,all_bytes[1000];
UpdateData(TRUE);m_input.MakeUpper ();
for (register i=0;i<=m_input.GetLength()-1;i++){
hbyte=m_input.GetAt(i);
|
|
|
|
|
See if this article helps at all.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
tantDear All,
Thanks for your immediately response. I download the demo and I looked into the MSDN. Could you please advice me where I made the mistake? I attach the I have written. I take an error that CDatabase does not exit or undeclared variable.
Thanks for your time.
Best Regards,
Konstantinos.
void CIsup_semi_1Dlg::OnOK()
{
// TODO: Add extra validation here
CDatabase database;
CString testing,final_bytes[1000];
int bytes,final_decimal[1000],cbyte,counter=0;
char buffer[50];
unsigned short hbyte,lbyte,all_bytes[1000];
UpdateData(TRUE);m_input.MakeUpper ();
for (register i=0;i<=m_input.GetLength()-1;i++){
hbyte=m_input.GetAt(i);
konstantinos
|
|
|
|
|
Do you include afxdb.h
whitesky
|
|
|
|
|
Hello to everyone,
I have developed a SDI MFC application. So what I want is when my mouse is hovering over the application window (any window.. main window, title, views anything), it should work properly, As the mouse moves out of application or windows , it should give some dialog box message that you are out of application area. now if mouse goes out of scope then it should not give so many dialog box messages.. only one is enough so that I wont be wasting time destryoying those messageboxes and go straight to application area. How can this be made?
row
|
|
|
|
|
if ur tracking the mouse leaving by checking the NC messages u should have to keep the flags to prevent multiple message box beign displayed...
Else
use TrackMouseEvent API
nave
|
|
|
|
|
I think TrackMouseEvent will be tracking only client area of the window .
(also which handler I would be keeping this function)
What I want is if the mouse is moving or clicking or hovering on any portion of the window, its ok, but when it completely goes out of application windows then it should give some kind of notification.
-- modified at 8:04 Monday 19th June, 2006
|
|
|
|
|
|
ROWALI wrote: I think TrackMouseEvent will be tracking only client area of the window .
no.
check the dwFlags of the TRACKMOUSEEVENT structure.There u can find TME_NONCLIENT
nave
|
|
|
|
|
Mine is a MFC SDI application.
So where can I keep this function? in Application class's OnIdle even or where?
|
|
|
|
|
Use global or class variables to determine if message is already on screen.
I guess I solve your problem?
|
|
|
|
|
Can you be more specific?
I dont get it.
|
|
|
|
|
How to get time difference in seconds.
CTime t1;
t1.GetCurrentTime();
after some time say after 3 seconds
CTime t2;
t2.GetCurrentTime();
Now I want difference between t2 and t1 in seconds that is 3 seconds;
Marcoslav
|
|
|
|
|
Instead of all the above use
DWORD dwStartTime = GetTickCount();<br />
<br />
<br />
DWORD dwStopTime = GetTickCount();<br />
<br />
Now the Difference ( dwStopTime - dwStartTime )
gives u the required difference in Seconds
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
NiceNaiduNow the Difference ( dwStopTime - dwStartTime )
gives u the required difference in Seconds
I think this will return the difference in milli seconds..
nave
|
|
|
|
|
Yes .u r right.
U will get the time difference in milli seconds.
Divide the difference with 1000 to get Seconds.
Thanks for the correction Naveen.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
In MFC, use subtract operator and CTimeSpan class:
CTime time1 = CTime::GetCurrentTime();
::Sleep(3000);
CTime time2 = CTime::GetCurrentTime();
CTimeSpan diff = time2 - time1;
LONG seconds = diff.GetTotalSeconds();
Note the usage of CTime::GetCurrentTime static function.
|
|
|
|
|
marcoslav wrote: t1.GetCurrentTime();
Wrong. Use this instead:
t1 = CTime::GetCurrentTime();
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
here i have project in that t require to select numbers radomely up to 65000.
#sankar#
|
|
|
|
|
If u want numbers between MIN to MAX,
Use
rand() % (MAX- MIN+ 1) + MIN ;
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
rand is limited to RAND_MAX value which is 32767, so with your technique, it won't work.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
So, wat is the function should i use ???
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
What I did when I wanted to have bigger number, was just adding the results of two rand. So, if it is up to 65000 this technique can work also.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
Cedric Moonen wrote: So, if it is up to 65000 this technique can work also.
But this does not ensure unique rand number.
If in one case : rand1 = 12345 , rnad2 = 3; randResult = 12348
If in the other case : rand2 = 12344 , rand2 = 4;randResult = 12348;
there is no guarantee of getting unique numbers.
There should be some other mean for getting rand numbers.
Hope I am not boring u Cerdic.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|