|
Hey, what's this field for?
"In an organization, each person rises to the level of his own incompetence." Peter's Principle
|
|
|
|
|
Our test team are developing a tool like QARun & Robot. You may ask me why we develop our own tool and do not use the professional tools. My manager thinks these tools can not help us to run testing well. He wants the new tool can get every GUI object's information easily on windows, and can accomplish the keyword-driven framwork well. Now the problem we meet is: we can not control the be-tested software well by using a series of keybd_event() and mouse_event(). I need the tool can simulate user inputs just like we do manually. Can you give me some advice?
thanks,
xia
|
|
|
|
|
Can two applications (running on two or same machine) broadcast data on the same multicast group? If yes, how is the message integrity preserved - i mean like messages getting intertwined ( part of msg1 .. part of msg2 .. rest of msg1 etc...)
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Thomas George wrote:
Can two applications (running on two or same machine) broadcast data on the same multicast group?
Yes.
If yes, how is the message integrity preserved
Not. Multicast is UDP, which by the very definition is unreliable.
i mean like messages getting intertwined ( part of msg1 .. part of msg2 .. rest of msg1 etc...)
That won't happen. You can get a complete message, a partial message (f.ex. if you exceed MTU) or no message from recvfrom(). Messages never get "blended" like this.
|
|
|
|
|
Thanks for the answer. I am not worried about partial messages or lost messages or partially lost messages. "Blending" was the only thing I was bothered about.
Thank you very much
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Guys, I've problem reading binary files using the following code. It works text/wri. Can you guys spot an error in this? Specifically, the pBuf in the code loads 0 or null after a certain number of loops even though the file huge.
void MyClass::Read(CString sFilename)
{
BYTE *pBuf = new BYTE[4096];
CFile pFile (sFilename, CFile::modeRead); //tried
//CFile::typeBinary too
int iReadSize = 0;
while(true){
iReadSize = pFile.Read(pBuf, 4096);
if(iReadSize == 0)
break;
else{
//my processing goes here
}
}
pFile.Close();
}
Any ideas?
Thanks.
JJ
|
|
|
|
|
the pBuf in the code loads 0 or null after a certain number of loops
Binary data can have null characters
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
So, Papa, how do I make sure the end of file has been reached? Still from the number of bytes returned from reading, right? But, my problem is that my buffer reads and loads "" into it..more likely, it loads nothing in the buffer.
void MyClass::Read(CString sFilename)
{
BYTE *pBuf = new BYTE[4096];
CFile pFile (sFilename, CFile::modeRead); //tried
//CFile::typeBinary too
int iReadSize = 0;
while(true){
iReadSize = pFile.Read(pBuf, 4096);
if(iReadSize == 0)
break;
else{
//my processing goes here
}
}
pFile.Close();
}
Thanks,
JJ
|
|
|
|
|
it does read, and fill the right values, but the prob is if u try to output it using a messagebox for instance it wont show cos the chars ur trying to print aint printable !
U can see an ascii table for more info
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Merc wrote:
Guys, I've problem reading binary files using the following code. It works text/wri. Can you guys spot an error in this? Specifically, the pBuf in the code loads 0 or null after a certain number of loops even though the file huge.
What sort of file are you reading. If it is an exe, dll etc. then it is highly likely you'll find lot's of 0's in the file. Or are you saying that iReadSize coming back with 0 before the end of the file?
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Hi,
You're right. The number of bytes returned from reading is ZERO before end of file has been reached.
When I check the pBuf, it has loaded "" into it..more likely, it loads nothing in the buffer. That's why it returns ZERO bytes. But this works for text/wri files though.
void MyClass::Read(CString sFilename)
{
BYTE *pBuf = new BYTE[4096];
CFile pFile (sFilename, CFile::modeRead); //tried
//CFile::typeBinary too
int iReadSize = 0;
while(true){
iReadSize = pFile.Read(pBuf, 4096);
if(iReadSize == 0)
break;
else{
//my processing goes here
}
}
pFile.Close();
}
Your thoughts on this will be very appreciated.
JJ
|
|
|
|
|
Merc wrote:
You're right. The number of bytes returned from reading is ZERO before end of file has been reached.
When I check the pBuf, it has loaded "" into it..more likely, it loads nothing in the buffer. That's why it returns ZERO bytes. But this works for text/wri files though.
Is this happening if you specify: CFile::typeBinary, because it shouldn't. Have you wrapped the Read in a try/catch block to see if an exception is being raised. This is what the VC++ docs suggest you do.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Hmmm, I'll try the try/catch thing and keep you posted. Yes, I did specify typeBinary. I'll check the MSDN website where I hog 24/7 for info. You're the only one who understood the problem right, you know.
Thanks for the input...catch you soon.
JJ
|
|
|
|
|
I believe your process code is setting pBuf = 0 at some point. That's why you get the ASSERT.
Todd Smith
|
|
|
|
|
Hi Todd,
That's not the case though. The number of bytes returned from Read(pbuf, 4095) is zero after couple of loops. Just this is only a problem for txt/wri files.
Thanks if you can help.
jj
|
|
|
|
|
I know that this is probably a very obvious solution but I'm just not getting anywhere with it. I tried setting the m_pszHelpFilePath to point to my chm file but I then get a blah.chm is not a windows help file or file is corupted error message. If I double click on the .chm file, it opens without any problems.
Does anyone know what I'm doing wrong?
well hell doesn't want you
and heaven is full.
Tom Waits
|
|
|
|
|
The online help in MFC uses WinHelp format (.hlp) files. Using the HTML help (.chm) requires more coding - you need to replace cals to WinHelp API with calls to HTMLHelp API.
You can find an example here[^].
Pavel
Sonork 100.15206
|
|
|
|
|
Thank you!!
well hell doesn't want you
and heaven is full.
Tom Waits
|
|
|
|
|
I downloaded the sample at the link you gave, and its missing
#include "htmlhelp.h"
No such file exists. I thought maybe its a windows file, but I dont have one on my machine. Any ideas?
Thanks,
ns
|
|
|
|
|
|
You need to install HTMLHelp Workshop (free MS download).
Pavel
Sonork 100.15206
|
|
|
|
|
That makes sense!
Thanks,
ns
|
|
|
|
|
CFileDialog is used to get a filename. But I need to get a folder where I will copy file to, what should I do? Thank you.
|
|
|
|
|
you can use the SHBrowseForFolder function.
lookup it in MSDN for detail.
|
|
|
|
|