|
Well, without more information I can't tell you what is wrong, but I do know ReadFile and WriteFile work just fine on W2k without hanging the program.
Are you using SetCommTimeouts?
Are you using Overlapped reads and writes?
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
Yes, I am using SetCommTimeouts, but overlapped I/O is not used.
Program is vary simple. Port is opened using CreateFile as follows
m_hComm = CreateFile(sPort, GENERIC_READ |GENERIC_WRITE, 0, NULL, OPEN_EXISTING, bOverlapped ? FILE_FLAG_OVERLAPPED: 0, NULL);
then comm timeouts are set as follows
memset(&m_commtimeouts, 0, sizeof(COMMTIMEOUTS));
m_commtimeouts.ReadIntervalTimeout += 2;
if(parity != NoParity)
m_commtimeouts.ReadIntervalTimeout++;
if(stopbits != OneStopBit)
m_commtimeouts.ReadIntervalTimeout++;
m_commtimeouts.ReadIntervalTimeout++;
m_commtimeouts.ReadIntervalTimeout += byDataBits;
m_commtimeouts.ReadIntervalTimeout *=
(int)ceil(1.0 / (double)dwBaud);
SetCommTimeout(m_hComm, &m_commtimeouts);
|
|
|
|
|
hey
anybody got any ideas as to why the following should be the case:
on a windows nt ws machine with a windows nt svr we use a simple server side file lock to prevent multiple accesses to the same data on the server (ie, the ws checks for a locked file before accessing data on the server) ... this works fine
same scenario but with a win2k client the file lock doesn't seem to show up
puzzled me and i wondered if anyone a) knows what i'm on about and b) has a clue as to why it should be so
---
"every year we invent better idiot proof systems and every year they invent better idiots ... and the linux zealots still aren't being sterilized"
|
|
|
|
|
Anyone got any ideas on how else to boost by internet speed (DL and UL)
Currently I'm altering IPMTU and MSS
FIFO Modem buffer
TCP Recieve Window Size,
And NDICache (although I don't even know what it does)
Anything else I should be trying,
I welcome any ideas
Regardz
Colin J Davies
|
|
|
|
|
hi all,
in my project, i have a long procedure to run (around 1sec). i want to display a kind of status on screen when this procedure running. i found some problem.
in my code,
CABC::OnButton1
{
this->SetWindowText("start"); // display in window caption
m_edit->SetWindowText("start"); // display in a editbox
LongProcedure();
this->SetWindowText("finish"); // display in window caption
m_edit->SetWindowText("finish"); // display in a editbox
}
the result is that, only window caption display "start" and "finish" accordingly. the editbox can only able to display "finish" after the longprocedure(). seems to me that, the editbox only update after the finished the OnButton1 procedure...
does anyone know how to display "start" in editbox, start the longprocedure(), and display "finish" in editbox after long procedure() accordingly?
regards,
Jim
|
|
|
|
|
Try calling m_edit->UpdateWindow () immediately after the call to m_edit->SetWindowText ("Start");
|
|
|
|
|
+----------+ +----------+
| Process1 | | Process2 |
+----------+ +----------+
| |
| |
+----|----------------|-----+
| | (Shared) DLL | |
| V V |
| Func1 Func2 |
| | | |
| +-V-----------+ | |
| | HANDLE hVxD |<---+ |
| +-------------+ |
+-------|-------------------+
|
V <----- hVxd = CreateFile(...)
+-------+
| VXD |
+-------+
Question> How to share 'hVxD' between 'Process1' and 'Process2' ?
Process 1 open device(vxd). then process 2 access the device using opened-vxd handle(hVxd).
I think use DuplicateHandle().
please let the show the details how to use it.
Thanks in advance.
|
|
|
|
|
Hello All,
How do I connect to Access database file directly without first registering the files with the ODBC Administrator?
Best regards,
Paul.
Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan, and open for programming contract anywhere!
|
|
|
|
|
For a good general answer to this question, look here:
http://www.able-consulting.com/ADO_Conn.htm#ODBCDriverForAccess
The relevant example to your question is:
For Standard Security:
oConn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=c:\somepath\mydb.mdb;" & _
"Uid=Admin;" & _
"Pwd=;"
|
|
|
|
|
Thanks so much, the link is great.
Best regards,
Paul.
Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan, and open for programming contract anywhere!
|
|
|
|
|
Hi,
I was wondering, if any one knows how to add hyperlinks to a dialog, in Visual C++ 6.0 Enterprise. I want to know how, by doing the OnHyperlink method.
Please help,
Casey
|
|
|
|
|
Hello,
Do you mean something like this...
http://www.codeproject.com/miscctrl/hyperlink.asp
Best regards,
Paul.
Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan, and open for programming contract anywhere!
|
|
|
|
|
Hi all!
How do we know what branch of the tree (CTreeCtrl) is clicked on.
Thank You
Vu
vucsuf
|
|
|
|
|
Can this help?
void CMyTreeCtrl::OnRightClick(NMHDR* , LRESULT* pResult)
{
CPoint point(GetMessagePos());
ScreenToClient(&point);
HTREEITEM hItem = HitTest(point, &nFlags);
}
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
|
Not really, I`m looking more for a straight conversion from a CString class to a CPoint class if its possible, by thanks for taking to the time to have a go, I appreciate that Paolo.
Alan.
AEGC
|
|
|
|
|
I'm not sure of what you're trying to do, but if you want to know where an item is, just call GetItemRect().
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
Hello,
I'm searching the last free version of the BCGControlBar.
I think it is the 4.7
Can somebody send it to me ?
thanks,
Stephane
|
|
|
|
|
I think the last free version was 4.75. I should have it somewhere on my disk, but do not know exactly where. However, I could easily fetch 4.73/4.74 for you.
You may however use the 5 series for the cool new features, and be supported too.
Best regards,
Paul.
Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan, and open for programming contract anywhere!
|
|
|
|
|
Hi!
How do I make an edit box only validate it's contents when
hitting the enter key? The edit box is attached to a
variable, and I only want the variable to get updated when
I hit enter.
Something that's not necessary, but a "nice to have" would be
doing the same thing for the tab key. Besides doing the
validation, it would also tab over to the next control.
Steve
|
|
|
|
|
You need to use the OnKeyDown. When you detect the Enter, you can validate the Edit.
Cheers!!!
Carlos Antollini.
|
|
|
|
|
The usual way of doing this is to handle validation in the OnKillFocus method call for that object. Then, hitting Enter (which will submit the dialog if the edit control is on a dialog) or hitting Tab (which will go to the next field in the tab order if if the edit control is on a dialog) will both kick-off that event.
If you're rolling your own interface in a non-dialog setting, you should be subclassing the parent window to pre process all the messages that come through your main window proc, and that would be where you would do Enter and Tab key handling (and other key for that matter).
|
|
|
|
|
Does anyone know of a technique to "raise events" between two class objects? For example I have class A and Class B, I make a change to one of the member variables in class B, could be 20 of them, how do I notify class A of the change so it can see what has changed and act accordingly? Sort of of like Windows WinProc?
Here are some simplistic ideas I have come up with
1. Create a system timer within class A and have it poll a "isDirty" variable in B and that is when it knows something is amiss.
2. Create a message queue in class A that B would send things too, and when A has a chance respond to the message.
3. Give up C++ programming and go back to Visual Basic (Not that I can do what I need to do within VB)
I don't prefer C because that might weigh heavily on system performance, and 2 seems more complex than it should, and I am definitely trying to avoid 3 !
So if any C++ gurus can give me a hint or point me in the right direction I would be mighty appreciative of yous. <g>
Sam C
----
Systems Manager
Hospitality Marketing Associates
|
|
|
|
|
Don't use the timer for such thing. It is bad .
Take a look at the "Observer" design pattern (I think there is an article on it on CodeProject). This is the way to go. Basically, you subscribe objects ("event sinks") to an object that raises events.
I vote pro drink
|
|
|
|
|
Dang that was a fast response
I can see not many people want me to go with option 3 either <g>
Let me take a look at the observer design pattern. Thanks again for the quick response.
Sam C
----
Systems Manager
Hospitality Marketing Associates
|
|
|
|