|
Great, I've isolated my debugging problem thanks to your help.
I'm simply debugging in one thread while another thread keeps refreshing the window in my back. Of course, because I'm stepping slowly, the resources keeps buffering in the refresh and the whole thing explodes rather quickly (somewhere out of my scope, I'm afraid).
At least, I know now a walkaround.
Thanks again,
Eric
|
|
|
|
|
Hi,
I have a question that for some could be one of the more challenging part of the design process for most winsock applications using Win32 API winsock tools. However, at the same time it is so fundamental among all winsock applications.
I am working on a client winsock program. The client logs onto a server and send and receive data. I am using WAsyncSelect() I/O model. The problem is current I can only program the application to support one client at a time. For example, let say the application is communication. The client sends messages to the server. Currently, the application can only communicate with one server at a time. I would like to be able to connect to multiple servers simultaneously.
The problem is I do not know which I/O model is best in the case above. With WAsyncSelect(), Windows manages the I/O notices. For example, if there are incoming data, Windows sends you a message FD_READ. My main concern is if I use this model and assign multiple sockets, how would I know which socket WAsyncSelect() refers to when it sends the application messaging such as FD_READ, FD_WRITE, and FD_CLOSE?
What I/O model do you recommend for a client program supporting multiple connections simultaneously?
Thanks,
Kuphryn
|
|
|
|
|
Hello, the codegurus around the world.;)
Even though I simply work for the server accepted by the mutiple clients,
the approach must be same.
We can use the linked list and create something like FindClientSocket
to find the only one client socket in FD_READ message handlers.
Or we can use CAsynsSocket and use CObList to restore the mutiple
client socket, and then try to find only one client socket by for loop.
Good Luck!
Please, don't send me your email about your questions directly.
Have a nice day!
Sonork - 100.10571:vcdeveloper
-Masaaki Onishi-
|
|
|
|
|
Thanks. I believe that is a good design. I am working on a design that include insertion of sockets into a STL data structure.
I will need some time to incorporate this new algorithm into the program.
Kuphryn
|
|
|
|
|
I don't know if i'm remembering correctly or if sleep deprivation will really make you remember things that don't really exist.
Anyways...a while back I could have swore I seen an article on how to make subclassed/custom controls flicker free while painting in DrawItem() . I'm not referring to Keith Rules CMemDC or any other *flicker free* articles this was more "What to do after this" like overriding OnEraseBkgnd for the controls parent and the control itself and this is why!!!
Am I dreaming or is there a article like this on CP I can't find it...i've tried Owner draw, flicker free, CListCtrl etc...and returned bunk results...i'd really appreciate if someone could show me the way...
Thanx in advance!
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I have done some reading on codeguru in hopes of finding what I was looking for and could only find an article.
The author suggests using his method of SetRedraw() and of course the comments that follow were interesting also.
Some say LockWindowUpdate(), but others say it's bad cuz it makes the rest of the screen flicker. One author displays a custom CListCtrl with it's OnPaint() and OnEraseBkgnd() over ridden...
You can do this...??? I think i've tried OnPaint before in the past to little if no success...am I wrong...?
I'm growing tired of looking for this info...I hope someone has an aswer for me...
Now i'm really tired so perhaps I should sleep
That feels nice...
cheers
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I have just bought a book on ATL COM and the author uses the reinterpret_cast<> operator. It seems like type casting would do the same thing. Can anyone tell me if there are advantages to one over the other, or is just preference?
Thanks
|
|
|
|
|
The advantage of using C++'s new standing casting technques including static_cast, reinterpret_cast, const_cast, and dynamic_cast is control. With these new casting standards, you know exact what type of cast the compiler will interpret from your code.
Kuphryn
|
|
|
|
|
|
There is no advantage to using reinterpret_cast - it does exactly the same thing (casts and overrides all type checking) and is much harder to type. dynamic_cast is about the only useful cast operator.
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Michael Dunn wrote:
There is no advantage to using reinterpret_cast
Yes there is: documentation. It clearly displays "This is something out-of-the-ordinary".
|
|
|
|
|
Hello gurus,
I'm generating a lot of metafiles and I want to build animation from them. How can I add all them to one gif or other animation format?
thanx in advance
marukas
|
|
|
|
|
marukas wrote:
I'm generating a lot of metafiles and I want to build animation from them. How can I add all them to one gif or other animation format?
Try to search for "AVIFile Functions and Macros" in the MSDN, you I´ll find all the information needed to create an AVIFile.
Mauricio Ritter - Brazil
Sonorking now: 100.13560 MRitter
|
|
|
|
|
hi all,
Here's one problem.
i have an dlg box without Title bar and i want to dispalay the system menu when i clik the alt spacebar. i want the menu in the corner that is displayed with the normal applicaation.
the other prob is that as there is no title bar the name of app doesnt appear in the small box which appears on the task bar when the application is running.
if any one can helpme out . i will be a pleaseure.
|
|
|
|
|
How to resume download from FTP site?
|
|
|
|
|
there are various commmands related to FTP
like get <filename> - for single file
mget - for multiple files
Renjith-CPian.
|
|
|
|
|
I don't really see, how those commands support download resuming. I checked at:
http://networking.ringofsaturn.com/Protocols/ftp.php
And, if it supports resume download: how can I execute such command?
Thanks
|
|
|
|
|
Hi!
Seems that CInternetFile has such functionality,
CInternetFile* OpenFile(...)
|
|
|
|
|
Hi virtual Friends,
I have started Windows Programming and i would like to know list of very good books on MFC 6.0.Also where can i get the freely downloadable ebooks for MFC.
Waiting for reply
Pradeep
|
|
|
|
|
Hi!
Look on internet for tutorials, it may be cheaper.
See amazon.com for books and their reviews.
See also:
http://www.funducode.com/books/books.asp
Hope that helps
|
|
|
|
|
Starting with Introduction to MFC Programming with Visual C++ 6.0 by Richard Jones.
The ultimate MFC book is Programming Windows with MFC Second Edition by Jeff Prosise.
Kuphryn
|
|
|
|
|
How many times, OnBeginPrinting is called for a print job ? Once per printing page, or once for the whole print document ??
I need the CDC, and CPrintInfo to calculate the no. of pages needed to print out. Is it a good place to put into OnBeginPrinting ?
If in case my report changes from Portrait to Landscape in the middle of printing. How can I get the new CDC and CPrintInfo describing my printer ?
Thanks
|
|
|
|
|
OnBeginPrinting is only called once per print job. OnPrint is called for each page. You can calculate the number of pages in OnBeginPrinting, but you may want to look at doing it in OnPreparePrinting. OnPreparePrinting is called before OnBeginPrinting, and it is responsible for popping up the print dialog, so if you want the "To" number of pages to show up in the dialog you need to calculate it in OnPreparePrinting.
I'm not sure on the last point, so I'll let someone else take it. You can get info on all the method calls on the MSDN site under info for the CView class, at the MSDN MFC View documentation page.
Hope this helps.
Mark
|
|
|
|
|
What message would be best used to handle the subclassing of the spinner control of a CTabCtrl ...??
I tried PreSubclassWindow and OnCreate but neither will do the trick.
I am assuming PreSubclassWindow isn't called when a window is created dynamically using it's Create() and subclassing the spinner in OnCreate() I assume won't work because the spinner control isn't created yet???
These are the conclusions i have come to using the debugger and AfxMessageBox () inside PreSubclassWindow() .
Where am I going wrong if I am...or what mnessage would best be suited to handle this task...??
p.s- I'm thinking OnSize...and use a local static bool flag to indicate whether the control has been subclassed already so the control only gets subclassed once...???
Thanx!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I have a list view and what I want to do is for one line ignore that fact that there are columns, so it would look something like this.
--------------------
Column 1 | Column 2
--------------------
text text
text text
text text
This ignores the columns.
text text
can that be done?
|
|
|
|