|
ok i will try with small file.
|
|
|
|
|
|
jiya-123 wrote: for(UINT i = 0; i < sizeof((pBuffer)/sizeof(BYTE)) ; i++)
Really? You do realize that loop equates to:
for(UINT i = 0; i < 4; i++)
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Please refer to: http://msdn.microsoft.com/en-us/library/aa363196(v=VS.85).aspx[^]
Regards.
Demian.
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."
-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )
|
|
|
|
|
for binary data, you have to make sure the driver doesn't interfere with the data at all; so you must check each and every port setting, including:
- pass NULL;
- don't change CR/LF;
- don't enable software handshaking.
FWIW: I tend to avoid binary communication over serial ports; when portability is more important than performance, I'd rather do some encoding, typically stuffing 2 bytes in 3 printable characters (i.e. the range 0x20-0x7E), so port settings wouldn't interfere with it at all.
|
|
|
|
|
hi Luc Pattyn do you have a sample code , so it will help to understood, still i am confuse
|
|
|
|
|
No, as I said I avoid doing such things as it is more trouble than its worth most of the time. I haven't done any binary serial comm on Windows using C/C++ in many years; and if I really had to do it today, I'd use C# anyway.
|
|
|
|
|
Just create a file pointer to the serial port com1/com2.
And do operations read file and write file with small chunks of data.
And about the UI(User interface ) that u can create using MFC dialog based application.
Silly matter only...
Thanking you
Krish
|
|
|
|
|
Chances are the eunuch guarding the serail port won't like binary data.
|
|
|
|
|
Generally, there's no problem sending binary data through a serial port if you are sure both ends are using full transparancy of the data, allow NULLs, CR/LF expansion (as mentioned by someone else above). XOFF and XON and EOF also need to be transparent.
The real issue is what do you do about "transmission errors"? There's no guarantee that serial data gets to the other side without problems, dropped bits, character framing errors. So, typically you have to wrap the data with some higher level checking, CRC, etc to ensure proper transmission of the data. Of course, since corruption is detected on the receiving side, you then need to tell the transmitter to re-send the data stream. Wait, this is beginning to sound a lot like a complete protocol.....
|
|
|
|
|
I've been there. And it might be easier/better to install SLIP and use FTP then. Unfortunately the OP never mentioned what the other side was, in fact he didn't give any context.
BTW: The transparency reply was mine also, this one was a reaction on the typo in the subject line.
|
|
|
|
|
Oh, a "serail port". Isn't that where they take containers directly off the ship and put them on trains (or visa-versa).
|
|
|
|
|
Hi,
I need VB or VC++ source code or any free tool to log the start up and shut down time of all the PCs connected in a lan to a file. Whenever any of the PCs in the Lan are Started up or Shut down, the utility should log the details including the event time in a file. If any body have source, Pl provide me.
Thanks in Advance
|
|
|
|
|
manoharbalu wrote: I need VB or VC++ source code or any free tool
Well I'm afraid if it's the former, you will have to write it yourself, if the latter, you should at least try a Google search first.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
For monitoring when a PC is started up, you'll need a service. For shutting down, you'll need to respond to the WM_ENDSESSION message.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hello,
I have a dialog box that contains a list box ,the problam is that if another window is cover the list box its delete the content of the listbox on the place that was covered and its not being apdate until I click on the listbox with the mouse or resizing it,
what can I do in order the listbox will be update outomatically?
thanks
|
|
|
|
|
This is not the default behavior of a listbox. What setting(s) have you changed?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hi all,
i want indentify all mouse click event in PreTranslateMessage,
but when i use WM_LBUTTONDOWN than WM_LBUTTONDBLCLK portion never called,
please tell me how can i identifies all events seprately.
please help me for this.
thanks in advance.
|
|
|
|
|
Greetings folks!
I created a DIB section with 4 bits per pixel, so 16 colors. I selected this DIB into a DC and am trying to draw into it using FillSolidRect and Ellipse, but all i get are zeroes in the pixel data. I specified the palette entries when creating the DIB, i also tried creating a CPalette from the DIB's palette and selecting it for the DC before drawing but no matter what i do i get nothing but zeroes. All the drawing code succeeds, so there's no visible indication of failure. What might i be doing wrong here? Here's some stripped down code:
unsigned char BIHeadMem[sizeof(BITMAPINFO) + 16 * sizeof(RGBQUAD)] = {0};
BITMAPINFO &BIHead = *(BITMAPINFO *)BIHeadMem;
BIHead.bmiHeader.biSize = sizeof(BIHead.bmiHeader);
BIHead.bmiHeader.biBitCount = 4;
BIHead.bmiHeader.biClrImportant = 0;
BIHead.bmiHeader.biClrUsed = 0;
BIHead.bmiHeader.biCompression = BI_RGB;
BIHead.bmiHeader.biSizeImage = 0;
BIHead.bmiHeader.biXPelsPerMeter = 0;
BIHead.bmiHeader.biYPelsPerMeter = 0;
BIHead.bmiHeader.biWidth = 32;
BIHead.bmiHeader.biHeight = -32;
BIHead.bmiHeader.biPlanes = 1;
for (int I = 0; I < 16; I++)
{
BIHead.bmiColors[I].rgbRed = BIHead.bmiColors[I].rgbBlue = BIHead.bmiColors[I].rgbGreen = (BYTE)I;
BIHead.bmiColors[I].rgbReserved = 0;
}
void *DummyPixels;
CBitmap bmp;
bmp.Attach(CreateDIBSection(NULL, &BIHead, DIB_RGB_COLORS, &DummyPixels, NULL, 0));
CDC memDC;
memDC.CreateCompatibleDC(NULL);
memDC.SelectObject(&bmp);
memDC.FillSolidRect(0, 0, fSizeCache.WellSize, fSizeCache.WellSize, RGB(0, 0, 0));
CPen pen;
CBrush brush(RGB(2, 2, 2));
pen.CreatePen(PS_SOLID, 1, RGB(1, 1, 1));
memDC.SelectObject(&brush);
memDC.SelectObject(&pen);
memDC.Ellipse(0, 0, 32, 32);
When i check the memory pointed at by DummyPixels , it's all zeroes, if i write to this memory "manually" the palette indexes from 0 to 15 i get what i expect when blitting the DIB to antoher DC, so the DIB itself should be ok. I guess the problem here is something completely obvious and i am just not aware of it. Thanks in advance for any help.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
I have a toolbar that uses a drop-down list. The list is owner-drawn and based on CListBox. It's displayed when the user pressing a button in the toolbar. When the toobar is floated outside the main window and the list is dropped, the list is clipped to the main window. Anyone know how to override that behavior?
I tried changing the parent from the main window to the desktop window but the draw messages don't get reflected to the list box.
I tried it with and without the WS_CHILD attribute.
|
|
|
|
|
I need a MFC app which I can give a directory and it will create a list of all files within that directory and sub directories. From this list it will then check the last time each file was modified. What would be the best way of going about this? I think of several ways of doing it but would like an opinion on what other people think would be the best way forward. Thanks.
|
|
|
|
|
FindFirstFile, FindNextFile, should do it quite easily. Just need to look at what you need to pass to it in terms of parameters. Or use CFileFind for straight MFC.
|
|
|
|
|
Hi all,
i m using Edit box control with multiline and want return property.
here i am paste very long file in this edit box but when i paste here full file data not paste and also when i trying to write some thiing its not written, while i m not use SetLimitText any where.
please tell me how can i paste any length of data in edit box.
thanks in advance.
|
|
|
|
|
|
i alraedy mention thet i already use it.
|
|
|
|