|
Thanks for your reply.Previously myButton is local variable in OnInitDialog function. I have changed it to member variable and I have allocated memory.It is working fine and it is displaying Radio Button.
I have changed this to Push Button. I need to add Event Handler to this Button.Can any one help me.
modified on Thursday, March 26, 2009 12:17 AM
|
|
|
|
|
you need to derive the new class from CButton and add the event handler in that class
|
|
|
|
|
I am in a loop, reading from an RS232 port. There are times when i receive an exception with a system message that says:
"The I/O operation has been aborted because of either a thread exit or an application request"
// read a byte from port
while (!m_bExit)
{
// reset flag variables
dwBytesRead = 0;
// read
bRC = ReadFile(m_hCommPort, pDataBuff, 20, &dwBytesRead, NULL);
dwError = GetLastError();
if (!bRC)
{
if (ERROR_HANDLE_EOF != dwError || ERROR_TIMEOUT != dwError)
{
LPVOID SysMsg;
// reterieve system message
FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
dwError,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR)&SysMsg,
0,
NULL );
// show system message
ZeroMemory( m_szBuffer, sizeof(m_szBuffer) );
wsprintf(m_szBuffer, TEXT("ReadRS232Data() over %s: ReadFile(), %s"), m_Port, (LPCTSTR)SysMsg);
LocalFree(SysMsg);
return 0;
}
}
Has anyone ever found a solution to this or know what would cause this error? Cause once this happens you cannot read from the port until it is out of this conditions which seems to just happen on its own.
Thanks in advance for any help or direction.
|
|
|
|
|
LCI wrote: I am in a loop
That sounds uncomfortable.
LCI wrote: or know what would cause this error
What is the number returned from GetLastError?
|
|
|
|
|
led mike wrote: That sounds uncomfortable.
|
|
|
|
|
I do not log the number that returns, but the related message is :
"The I/O operation has been aborted either because of a thread exit or an application request."
BTW, i cannot reproduce. I just know when it happens.
|
|
|
|
|
Hi All
How can i Use AfxmessBox through Catch(exception)?Plz help me
i have code like this
try{
}
catch(exception er)
{
AfxmessBox(er)
}
Plz help me
|
|
|
|
|
By calling exception::what() maybe ?
try
{
}
catch(exception er)
{
AfxmessBox(er.what());
}
|
|
|
|
|
|
Cedric Moonen wrote: AfxmessBox(er.what());
New Api i think ... I think this must be AfxMessageBox()
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Yeah, but I just copy/pasted his code
Programmers are lazy you know...
|
|
|
|
|
Hello Dear Friends,
How to develop the toolbar that resides on IE status bar.
For example if I've Google Toolbar installed in pc pressing Ctrl + F open up the search toolbar just above the IE status bar.
How can I achieve this.Any refrence materials or code would be appreciated.
ritz1234
|
|
|
|
|
this link^ may help you
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
Hi Mahesh,
Thanks for the reply I've already taken help from this link and I've also developed the IE toolbar. But the thing is I want to develop the Findbar which resides at the bottom of the IE like google Findbar.I want to know how can I do that?
ritz1234
|
|
|
|
|
Hello to all,
In my project I am using a virtual com port means when I connect my device to USB port of a computer then computer creates a virtual serial port and when I disconnect that device then that port gets destroied.Now for my software I need "latency timer(msec)"(which we find in "Advanced" settings of a port) of this serial port to be "10", by default it is "16" there.So my question is can we change this "latency timer(msec)" of a port through programm at the time of opening the port? and if yes then how?
Means suppose e.g. I connected my device to the USB port of a computer and computer created a virtual port as "COM 5" then by default "latency timer(msec)" of this "COM 5" will be "16" and I want to change it to "10" then can I do it through programm itself at the time of opening "COM 5"? Its really urgent so please can anybody help me?
Thanks and Regards,
Anay
|
|
|
|
|
What is this "latency timer(msec)" exactly ? Is this something specific to your device ? How do you set it usually (you are talking about an "Advanced" settings but from where is that coming from ?).
|
|
|
|
|
No this is not my device specific. when we see the port number(right click on "My Computer" then go to Properties->Hardware->Device Manager->Ports(COM & LPT) ) double click on that port number in that u will get "Port Settings" option, click on it and then click on "Advanced" button, here u will get "latency timer(msec)" option.
|
|
|
|
|
Could be that GetCommProperties and Set.. will let you set this, it may append the 'latency' variable as below ...
WORD wSize = lpCommProp->wPacketLength = sizeof(COMMPROP);
if(!GetCommProperties(m_hPort,lpCommProp))
|
|
|
|
|
MFC reg edit function use..
FTDIBUS - LatencyTimer (DWORD - 16 (default))
|
|
|
|
|
Hi all,
how can i resolve this error of 'CeGetDeviceId'.
and for lib files:
fatal error LNK1181: cannot open input file 'rapi.lib'
fatal error LNK1181: cannot open input file 'ceutil.lib'
please help me for this.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
You you working on which application, I mean Window application or Handheld application?
if you working on window application, I am afraid you can't use above api!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
ThatsAlok f you working on window application, I am afraid you can't use above api!
As far as I remember (it's been a long time I didn't use RAPI), it is the opposite (see here[^]): from a desktop application, you are able to perform actions on a Windows CE device which is connected to the desktop computer.
|
|
|
|
|
I want to connect windows mobile to my application.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
"_$h@nky_" wrote: how can i resolve this error of 'CeGetDeviceId'.
Did you include the "ceutil.h" header file (which should be on your include path) ?
"_$h@nky_" wrote: fatal error LNK1181: cannot open input file 'rapi.lib'
fatal error LNK1181: cannot open input file 'ceutil.lib'
Where did you put those libraries ? They should be on the library path.
|
|
|
|
|
yes i m include ceutil.h.
and write these lib name in
Poject property->Linker->Input->Additional Dependencies.
please help me for this.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|