I dug a bit deeper and in fact the _base pointer instance is new'ed as the sub classes.
And now I saw that, I remember from about 12 years ago, that I have seen this before. Spent the last 10 years pretty much 100% in the kernel so I guess I got a bit rusty with the old C++ inheritance game.
Have you still not solved that issue? VS should step into virtual funcs - I do it every day, using VS 2003, and now that I switched it to VS2010 it works just as well.
Apart from your debugging a remote program - I haven't done that myself, the only thing I can think of is that your code does something different than you think it should. but without seeing the code we can't say. Can you extract the relavnt bits of your code (i. e. the declaration of the virtual func in the base class and how you overrode it in your derived class) and post it?
Great link! The explanations are even better than those found in Stroustrup's 'The C++ Programming Language' (that's what I checked, I was especially curious about :? and am somewhat disappointed that there isn't even a good reason against overloading it. I could think of a good use or two...)
The mentioned operators are used for only one purpose. Example in c++ the '.' operator used only for accessing member functions. (so there is no use of overloading '.' )
But the symbols (+,- and etc..) are used to add numbers and objects .
By default '+' operators are used for adding the numbers only and not the objects
(we are overloading the '+' operator to add the objects )
In c++ operator overloading takes the meaning as below
Operator Overloading: customize the operator to do other operations also(other than default operation).
The documentation states the mmioxxxx provides for unbuffered and buffered files.
The CFile supports only unbuffered files.
I am sending the data retrieved by wave API ( from buffer) to the mmioxxxx file.
So do I need mmioxxxx or not?
I am "doing" MFC in VC++
Any contructive help will be as always appreciated.
Since I got my wave API going I 'll tackle this mmioxxx.
I do not remember but I think I done CFile before so it should not be much of a struggle this time.
I think I picked this mmioxxxx because the guy I copied it from build the wave file header and really did not explained why it was build that way. Most of the time when I use someone else program like that ( poorly documented) I get burned in the long run!
For example the stuff I used for wave hardly checks the functions returns. I think that is not very good programming style.
I think I need to read up on buffered and unbuffered files too.
Hi guys. I am stuck again with IOCP again. The problem is that, i just cannot create more then one worker thread. If i'll create more then one worker thread, for example 10 and on the other side there are 10 client connections, everything crashes in a random places, or it crashes because buffer for WSARecv is not allocated while in debugger i can see perfectly allocated buffer, or it crashes because socket is invalid - i just dont get it. While it is only one thread - it is working perfectly, when there more threads, it becomes unstable, and when there are 10 or more, it crashes after 1 second. Is there some magic trick i am missing again?
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
The IOCP knows nothing about how many threads there are beyond how many are waiting on ::GetQueuedCompletionStatus().
There's no correlation between number of sockets (one for each client) associated with the IOCP and the number of worker threads. In fact, one thread per client is wrong and exactly what IOCPs are meant to eliminate.
So something is up in your code (obviously? ).
You can't share completion packets (OVERLAPPED structs) between sockets.
If the threads are accessing any common data objects then synchronization must be used.
For what it's worth, here's an example of an OVERLAPPED struct from one of my apps. Maybe it will spark something on your end...
CClientConnection is a class that holds client information and also holds the socket handle and associated information.
pData is the I/O buffer, and is reallocated for each I/O operation. In my protocol I send a header of a known size first. That header has the number of following data bytes to expect.
dwDataLength and dwDataLengthProcessed are used tohandle situations where a single WSASend/WSARecv call doesn't process the total number of bytes requested. This MUST be done! There's no guarantee send and recv operations will send or receive all the bytes in one call. Successful completion could mean just a single byte!
Hey Mark. The worst thing is, i am sure that i am doing everything the exact same way but something is always wrong. I can give you the code only if i could send it to you - it is a solution with 5 projects and there are a LOT of lines, if you could take a look at it and point out mistakes i would appreciate it so much!!! (because i desperately need help with this ), can i ask you for this? please? My email: info[at]machinized[dot]com or maybe you can post yours, then i can send you the code. I am in pain