|
hi...
Thanks for ur replies...
i think ur right may b the event is not signalled.... code is as below
aslso its not my code and, event created is ITC_APP_EVENT_RIGHTSCAN...i have no idea where ITC_APP_EVENT_RIGHTSCAN comes from.....
hCenterDelta=CreateEvent(NULL, FALSE, FALSE, _T("ITC_APP_EVENT_CENTERSCAN"));
hCenterState=CreateEvent(NULL, TRUE, FALSE, _T("ITC_APP_STATE_CENTERSCAN"));
hRightDelta=CreateEvent(NULL, FALSE, FALSE,_T("ITC_APP_EVENT_RIGHTSCAN"));
hRightState=CreateEvent(NULL, TRUE, FALSE, _T("ITC_APP_STATE_RIGHTSCAN"));
hLeftDelta=CreateEvent(NULL, FALSE, FALSE, _T("ITC_APP_EVENT_LEFTSCAN"));
hLeftState=CreateEvent(NULL, TRUE, FALSE, _T("ITC_APP_STATE_LEFTSCAN"));
hIRDAReset=CreateEvent(NULL, TRUE, FALSE, _T("NOTIFICATION_EVENT_WAKEUP"));
h = CreateEvent( NULL, TRUE, FALSE, EVENTNAME_KEYBOARD_CHANGE );
if ( h != INVALID_HANDLE_VALUE ) {
SetEvent( h );
CloseHandle( h );
} // end if
//the closed event
hClosed = CreateEvent(NULL,TRUE,FALSE,_T("RfidCloseEvent"));
HANDLE hObjectList[] =
{
hClosed,
hCenterDelta,
hRightDelta,
hLeftDelta,
hIRDAReset
};
while (1)
{
DWORD wc = WaitForMultipleObjects(
sizeof(hObjectList)/sizeof(HANDLE), // number of handles in array
hObjectList, // object-handle array
FALSE, // wait option
(DWORD) INFINITE // time-out interval
);
//THE breakpoint holds at this point...
switch ( wc)
{
WAIT_OBJECT_0 + 2: //Center button
if (WaitForSingleObject(hRightState,0)==WAIT_OBJECT_0)
{
//some code
}
etc..etc..
}
}
LET ME KNOW UR THOUGHTS
bye
|
|
|
|
|
The only thing I see in your code sample is
WAIT_OBJECT_0 + 2: //Center button
WAIT_OBJECT_0 + 2 corresponds to the hRightDelta event handle, not the hCenterDelta event handle.
Remember the array is indexed from 0
If you put a breakpoint on the switch ( wc) line and execution never pauses there then none of the
five events eing waited on are getting signalled.
Mark
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
hi Mark...
I found that the events ITC_APP_EVENT_RIGHTSCAN etc ..were not present in the devices registry...so i added these events ..but still that event does not get signalled ....
my device uses WIN CE 3.0...but the event gets signalled for another device which has WINCE 4.2
does this mean that 3.0 does not recognise ITC_APP_EVENT_RIGHTSCAN??...if so then how do i find which is the correct event
thanks
|
|
|
|
|
Hmm I have no idea how event objects relate to the registry.
You are creating named event objects in your code. That means if an event with the same name
already exists on the system then you'll get a handle to that same event. If the event does not
already exist in the system, you get a new event object.
Are you sure these "ITC_APP_EVENT_xxx" strings represent the name of named events in another
process? This has nothing to do with the registry.
Mark
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
How could i distinguish a DVD-RAM from a flash memory card
(both are Removable storage drives)
in runtime?
|
|
|
|
|
I hope "GetDriveType" API will return
DRIVE_RAMDISK for DVD-RAM Disk and
DRIVE_REMOVABLE for Removeable Drive.
Thanks & Rgds,
Sri..
|
|
|
|
|
Hai,
Good Evening....
I was working with the controls of textbox i have a doubt in that can anyone
clear it....
I created a form in MFC by having various controls.
1.In that i have a textbox in which iam entering some values.
2.I want that value to be printed in the message box...
Can anyone please tell me how to do....
Thanks
Harshadha
|
|
|
|
|
You have a editbox CEdit m_EDit; and it has values "12345" now you want to show these values use of m_Edit1.GetWindowText();
|
|
|
|
|
hai,
i cant understand ..
Iam passing values to the editbox in run time ,then if i click a command button iam displaying a messagebox,where i want these value to be shown...
Harshadha
|
|
|
|
|
Use the text got by m_Edit1.GetWindowText(); with the MessageBox method...
|
|
|
|
|
When click button use of
CEdit m_Edit;
CString str;
m_Edit.GetWindowText(str);
MessageBox(str);
And if you want to set a value dynamicly for editbox use of SetWindowText
|
|
|
|
|
Use WM_KILLFOCUS for your text box and get the text using GetWindowText . I hope this is you want.
|
|
|
|
|
Hai,,
I cant really understand i brief my question..
Iam entering the values in edit box during runtime and displaying it...
CEdit m_ce;
m_ce.GetWindowText();
TCHAR szMsg[256];
wsprintf(szMsg,_T("hEIGHT: %ld "),m_ce);
MessageBox(szMsg,NULL,MB_OK);
error C2661: 'GetWindowTextA' : no overloaded function takes 0 parameters
Thanks For Spending Your Precious Time
Harshadha
|
|
|
|
|
int GetWindowText( LPTSTR lpszStringBuf, int nMaxCount ) const;<br />
void GetWindowText( CString& rString ) const;
Use as below
CEdit m_ce; <br />
CString str;<br />
m_ce.GetWindowText(str);<br />
TCHAR szMsg[256];<br />
long lValue = _ttol((LPCTSTR)str);<br />
wsprintf(szMsg,_T("hEIGHT: %ld "),lValue);<br />
MessageBox(szMsg,NULL,MB_OK);
-- modified at 6:26 Thursday 8th March, 2007
|
|
|
|
|
Hai,
Iam sorry for troubling you again but iam getting memory error like asking
whether to retry or abort...
If i click ignore its displaying msgbox with 0 in it..
Thanks
Harshadha
|
|
|
|
|
have you done validation on the text box like the input is only numeric value and not alphabet nor alphanumeric...
|
|
|
|
|
|
Hi,
I think u havent created a member variable for the editbox. Simply you would have written like
CEdit m_ce;
It ll not work out.
First you need to create a member variable for the edit box using class wizard with the control type as Edit.
say, the member variable is m_editChar. then,
CString str;
m_editChar.GetWindowText(str);
MessageBox(str);
now, the str ll give u the value entered by the user in the edit box.
Hope this ll solve your problem.
Thanks & Rgds,
Sri..
|
|
|
|
|
|
I wrote for you an exmaple and also GetWindowText needs to a parameter for hold values
|
|
|
|
|
harshadha wrote:
TCHAR szMsg[256];
wsprintf(szMsg,_T("hEIGHT: %ld "),m_ce);
So then why are not using CString with your MFC application?
harshadha wrote: MessageBox(szMsg,NULL,MB_OK);
Consider using AfxMessageBox() .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hai,
Thanks a lot to all...
i got the output....
Harshadha
|
|
|
|
|
I hope you got your answer with best way
|
|
|
|
|
Hi,
If iknow the filename and its path i hould be able to open and display that file.if any ideas on how to do it please let me know..
harsha
|
|
|
|
|
Which? Open a file or get path of a file?
|
|
|
|