|
Is tat is only way. I meant is there any API exists which will notify me for File IO?
|
|
|
|
|
vikrams wrote:
...is there any API exists which will notify me for File IO?
None that I know of. There are ways of being notified that a file/folder is being changed, but you'd still have to periodically poll to check when those operations are actually finished.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Okey. Thanx a lot for help.
|
|
|
|
|
Hi all;
I am developing an SDI application which consists of a CDialogBar. On the bar, i have a tree control displaying some data. I also have a webbrowser control in the View. I need to display an HTML page in the webbrowser control according to the selected tree child clicked by the user. Can somebody, please help me, to access the webbrowser control from my TreeControl.
Thank you
Krugge
|
|
|
|
|
Hi all;
I have downloaded Skin Magic in order to build custom skins for my application. Everything works fine and i have exported the .h file associated with my skin. The problem is now, "how will i include the skin in my application?".
Can somebody please help, i'm pretty at lost with this issue.
Thanks
Krugger
|
|
|
|
|
Hello,
This arrives at my serial port:
924.09,-4.06,676.26,0.156488,-0.653856,-0.714853,-0.192273
<br />
CString nx;<br />
<br />
while(port.Read(cReceivedChar, 1 , overlapped, &dwBytesRead)) <br />
{<br />
<br />
nx += cReceivedChar[0];<br />
SetDlgItemText(IDC_SHIFT_X,("%c", nx));<br />
}<br />
but my dialog only shows 06,676 ?? Why?
Thanks, Mark
|
|
|
|
|
What is in nx?
Try a MessageBox call
and why not a SetDlgItemText(IDC_SHIFT_X,(LPCSTR)nx);
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hello,
nx contains nothing when i trace it.
cReceivedChar[0] contains confused values from the string..
I think the whole procedure must be rewied
Thanks, Mark
|
|
|
|
|
CString nx;
char cReceivedChar;
while(port.Read(&cReceivedChar, 1, overlapped, &dwBytesRead))
nx += cReceivedChar;
SetDlgItemText(IDC_SHIFT_X, nx);
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
char cReceivedChar; is not working (other type expected)
<br />
BOOL CSerialPort::Read(void* lpBuf, DWORD dwCount, OVERLAPPED& overlapped, DWORD* pBytesRead)<br />
Thanks, Mark
|
|
|
|
|
How are you calling the Read() method?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
while(port.Read(cReceivedChar, 1 , overlapped, &dwBytesRead))
Thanks, Mark
|
|
|
|
|
The first parameter is supposed to be a pointer.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
<br />
<br />
char *cReceivedChar;<br />
<br />
while(port.Read(cReceivedChar, 1, overlapped, &dwBytesRead))
Thanks, Mark
|
|
|
|
|
But then you'd have to allocate one byte of memory from the heap (i.e., cReceivedChar = new char ). Why not just use this instead:
char cReceivedChar;
while(port.Read(&cReceivedChar, 1, overlapped, &dwBytesRead))
...
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
yep, it seems to be better to use a reference.
with this procedure my string output is only "0.1922"
remember incoming:
924.09,-4.06,676.26,0.156488,-0.653856,-0.714853,-0.192273
It looks like that the first values running through the digits in the dialog..mmh?? Is this so complicate to give out the full string?
Thanks, Mark
|
|
|
|
|
macmac38 wrote:
yep, it seems to be better to use a reference.
My example was not a reference. It was a pointer, exactly what the Read() method is expecting. Had it wanted a reference, the signature would look like:
BOOL Read(void& lpBuf, ...); You mentioned that 924.09,-4.06,676.26,0.156488,-0.653856,-0.714853,-0.192273 is arriving at the serial port. How are you verifying this?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
This is the position string from a robot arm and every time the same format.
x,y,z shift and quaternion 1-4
I have to extract them later from the string in float variables
Thanks, Mark
|
|
|
|
|
That's all well and good, but in your original post, you indicated that "This arrives at my serial port," implying that the data is indeed there. That's why I asked how you were verifying it.
In the while loop that you are using to read the incoming data, how many times does the loop execute?
After each call to Read() , what is the value of dwBytesRead ?
If the incoming data is always in the same format and is always less than X bytes, you might could use this instead:
char received[X];
port.Read(received, sizeof(received), overlapped, &dwBytesRead);
received[dwBytesRead] = '\0';
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
<br />
received[dwBytesRead] = '\0';<br />
what does this line mean? I have "access violation" with this line.
Thanks, Mark
|
|
|
|
|
macmac38 wrote:
what does this line mean?
It appends a \0 character to the end of the string.
macmac38 wrote:
I have "access violation" with this line.
How big is the received array, and what is the value of dwBytesRead ?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
<br />
char received[40];<br />
<br />
port.Read(received, sizeof(received), overlapped, &dwBytesRead);<br />
<br />
TRACE( "Bytes read: %d",dwBytesRead);<br />
<br />
received[dwBytesRead] = '\0';<br />
<br />
SetDlgItemText(IDC_SHIFT_X, received);<br />
<br />
Bytes read: 1Bytes read: -858993460Bytes read: -858993460Bytes read: -858993460
Thanks, Mark
|
|
|
|
|
macmac38 wrote:
TRACE( "Bytes read: %d",dwBytesRead);
Since dwBytesRead is a DWORD , you'll need to use the %lu format.
Nonetheless, if received[] is only 40 bytes, trying to access the -858993460th position, or any value outside of 0-39, is obviously wrong. Check the return value of Read() beforehand.
In your original post, you indicated that 58 characters were being sent to the serial port. You'll need room for that plus one more so received[] should be 59 not 40. This is not the root of the problem, however, but will eventually need to be addressed.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
<br />
<br />
char received[59];<br />
<br />
port.Read(received, sizeof(received), overlapped, &dwBytesRead);<br />
<br />
<br />
TRACE( "Bytes read: %lu",dwBytesRead);<br />
<br />
received[dwBytesRead] = '\0';<br />
<br />
SetDlgItemText(IDC_SHIFT_X, received);<br />
Bytes read: 1
I donn't know where's the problem? Normaly it seems easy..?
Like to solve it today
Thanks, Mark
|
|
|
|
|
macmac38 wrote:
I donn't know where's the problem?
Are you sure a problem exists? Maybe there was only one byte available to read.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|