|
Can anyone explain me somethings about the COMMTIMEOUTS struct of the SetCommTimeouts API function?
When I set the ReadIntervalTimeout member to MAXDWORD and the ReadTotalTimeoutMultiplier and ReadTotalTimeoutConstant to 0 the ReadFile operation doesn't wait. Is that right?
And what's with the Write... members? When I write 0 to this members, the timeouts will be ignored and the WriteFile function doesn't wait. Is that also right?
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
Yes, that's right.
Quoted from MSDN:
"A value of MAXDWORD, combined with zero values for both the ReadTotalTimeoutConstant and ReadTotalTimeoutMultiplier members, specifies that the read operation is to return immediately with the characters that have already been received, even if no characters have been received."
"A value of zero for both the WriteTotalTimeoutMultiplier and WriteTotalTimeoutConstant members indicates that total time-outs are not used for write operations."
Maybe you should read a little bit, eh?
Cheers,
Fredrik
"Felix qui potuit rerum cognoscere causas."
|
|
|
|
|
I am doing sometimes a little bit of serial communications. You have to read a BIG bit and test, test, test ... til u drop
Try this @ home. (B&B)
|
|
|
|
|
I have been looking for bar, line, and pie chart/graph in c++ that I can add to my project. I do not mind paying a reasonable fee, but everything I have seen is for .Net. I need c++ that can be used in my projects. Any leads?
"Best file compression around: DEL *.* = 100% compression."
<><><><><><><><><><><><><>
Matthew R. Miller
mattrmiller@computersmarts.net
www.computersmarts.net
|
|
|
|
|
|
Thank you for your efforts, unfortunately I have seen all of those with no luck. I am now searching the internet for commercial graphs. Thank you.
"Best file compression around: DEL *.* = 100% compression."
<><><><><><><><><><><><><>
Matthew R. Miller
mattrmiller@computersmarts.net
www.computersmarts.net
|
|
|
|
|
|
I have the following sample code in a DLL:
#define DllExport __declspec( dllexport )
#include <vector>
class DllExport Archive
{
protected:
std::vector<void*> m_vPointerStored;
};
and get the following warning:
d:\libs\saiggeneric\test.h(11) : warning C4251: 'm_vPointerStored' : class 'std::vector<void *,class std::allocator<void *> >' needs to have dll-interface to be used by clients of class 'Archive'
It only seems to be a problem with STL members.
My understanding is that using __declspec( dllexport ) for a class makes the class and everything in it exportable. I'm trying to build a straight C++ DLL, not an MFC Extension DLL. I don't know if this has anything to do with the problem. Help!!!!
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
|
Thanks, that's exactly what I needed to know. I had searched around the MS Web site, but didn't find this.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
dear all,
how can i display value of variables of sdk datatypes like DWORD, LPTSTR... in a message box
thanx
|
|
|
|
|
convert into string first then you can display anything!!!!! as far as i know..
cheers..
Himanshu
|
|
|
|
|
I want to manipulate the camera (connected to my computer) such as capturing video stream for cam chat, or video conferencing for further... So that I must know how to use, to control,... the camera throught the camera's driver. Please show me the way to start.
Thanks in advance !
aTpnT
|
|
|
|
|
There are examples for this in the DirectX SDK (amongst the DirectShow examples)
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
I think your reply is so useful to me. Thanks so much, 'benjymous'!
aTpnT
|
|
|
|
|
Hi All,
I would like to initialize a char array to hold a path retrieved from a registry key. If I used _MAXPATH constant from stdlib.h like this .... TCHAR MyPath[_MAXPATH], would this ensure that the array will be large enough? Even on 98, XP, NT?
Thanks
Paul
|
|
|
|
|
Never trust your inputs, especially when the source is the registry. Any user could go change your data to something longer than MAX_PATH , which would overrun your buffer, and we all know that only leads to Bad Things.
Call RegQueryValueEx() with NULL and 0 as the buffer and size respectively, and you'll get back the exact size of the value in bytes. Alloc a buffer of that size, and you'll always have a big-enough buffer. Check the type as well, make sure it's REG_SZ like you expect.
--Mike--
I'm bored... Episode I bored.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Thanks Mike,
I knew there had to be a way.;)
Paul
|
|
|
|
|
I would not stick to it. As someone says, never trust your inputs - that's the first reason, second reason is, that this will hardcode the _MAX_PATH to your buffers forever. And now it might be that these 260 chars is enough, but will it be enough next year?
|
|
|
|
|
Hi,
I am currently undertaking a project a requires the development of a Windows based application. I have some experiance in C++ coding but up to now all the programs I have coded have been command prompt run applications.
Just wondering if anyone knew of any good books that would get me started in learning how to program Windows applications. I have looked but there seems a vast amount out there. I am thinking I would rather use the MFC libarys rather than making direct calls to the Windows API itself. Good idea??
Any recommendations would be greatly appreciated
Thanks in advance
|
|
|
|
|
Without MFC
http://www.amazon.co.uk/exec/obidos/ASIN/157231995X/ref=sr_aps_books_1_1/202-2181440-5510268
With MFC
http://www.amazon.co.uk/exec/obidos/ASIN/1572316950/ref=pd_sim_b_dp/202-2181440-5510268
Two of the best programming books for Windows as far as I know. They also double as great weightlifting training because of the size of them
|
|
|
|
|
Hi,
how can I be sure to include all needed DLLs with my packages? I'm using Depends but it shows a bunch of DLLs, such as Kernel or GDI and others. Some of them are probably already on the user's system but what I need to know if which one to include and where to install them (directly in the installation path or system32) ???
Thanks!
---------------
Tired of Spam? Introducing InboxShield® for Microsoft® Outlook®
http://www.edovia.com
|
|
|
|
|
if you have an MFC app, then any of the dll's named mfcXXX.dll you will need to redistrib. Also msvcrtXXX.dll. If you have any C++ that touches the Standard Library, then you will probably need msvcpp60.dll (I am assuming you are using VC6, and the STL that comes with it, if you are using STLPort's STL then use their lib)
For other stuff, you'll have top track that down. For example if you are using DirectShow in your app, then there are redistribs with that (don't know what they are).
Likewise for other stuff like ADO, et al...
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
|
|
|
|
|
I'm using STL and ATL 7.0...
---------------
Tired of Spam? Introducing InboxShield® for Microsoft® Outlook®
http://www.edovia.com
|
|
|
|
|
OK well you should be OK. Be warned that I do NOT have VC7 and have not used it, so there could be other issues, different libs, etc. With ATL 3, depending on how you built your project, you also had to distribute the ATL.dll and there was a different version for Win9x OS vs. NT OS. Don't know if this is still the case.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
|
|
|
|