My MFC application needs to monitor a directory on a network disk (mapped as Z , and I'm using FindFirstChangeNotification() to do this. However, I am getting an INVALID_HANDLE_VALUE returned, and GetLastError() return 56 (which appears to be "The network BIOS command limit has been reached."
If I change the path of the monitored folder to a local drive, it works fine. How do I get over this problem ? (MSVC 6.0 - Win2000) (All the results from a Google search only seem to refer to a server situation)
But the loop gets suspended at WaitOnMultipleObjects() after the very FIRST invocation of FindFirstChangeNotification(). (The whole reason for using this approach is to get away from a polling mechanism which introduces a delay) As I said originally, the code works fine when the target is a local disk - something to do with network, and I don't know how to fix it !!)
Hi Killabyte, Actually, I'm getting the problem single-stepping in the debugger, so the loop isn't executing as such. Also the WaitOnMultipleObjects() has an INFINITE timeout. I don't quite know how FindFirstChangeNotification() is implemented, but presumably the problem resides in the firmware of the network disk controller - have logged on to it, but can't see any parameters in the SMB server that I can tweak. Or am I missing something here ?
Hi again, I had seen <a href="http://support.microsoft.com/kb/810886[^]">http://support.microsoft.com/kb/810886[^]</a>[<a href="http://support.microsoft.com/kb/810886[^]" target="_blank" title="New Window">^</a>] already - it only seems (unless I have missed something) to address the situation where the FindFirstChangeNotification() is aimed at a SERVER and then you can edit it's registry accordingly. In this case, the target is a network disk and that is why I logged on to it to see what parameters were available for tweaking - basically none !) I'd be surprised if I'm the first person to hit such a problem !
P.S. I clearly don't know how to insert a link (copied from a previous posting) in a new posting !!
Hi Killabyte, Yes !! When you logon to 192.168.1.9 using a browser, the facilities provided are minimal. Don't forget that the whole thing is implemented in firmware !! Basically, I'm beginning to think that I'm at it's mercy, and I'm stuffed !!! (Will have to stick with my old polling mechanism after all ... unless someone knows different ...... !
I think I am missing out something but dont know exactly where I am wrong ...
I am getting followinf Error in MS Visual Studio8 (Error C2106 : '=': left operand must be |-value..... (I am not getting wht this error iss for..........? )
You can't just assign arrays like that. You need to copy the contents of the source array to the destination array.
memcpy(ArrayData, ps->Data, MAX_TP_DATA_BYTES);
If you are using VS2005 or later you really should use the safer memcpy_s method instead because the memcpy method has been deprecated. The difference is that the memcpy_s method takes an extra parameter stating the size of the destination buffer and the method also now returns an error_t.
I am looking for your opinion - not asking for code or someone to do my work.
I have ASCII text files that consist of several thousand four digit numbers in each file. My job is to write a program that counts how many times each four digit number appears in each file.
Every four digit number will be on it's own line, like this:
I know how to iterate the list. I have had several ideas on counting the individual numbers (in other words, how many times does 7737 etc appear in the file) but none that I think are very efficient - and whereas some of the best programmers in the world frequent this excellent place, I wondered if someone could give me an idea on a concept.
ok you challence me, but your question is too generic: what is the distribution of the numbers? And tell me more about the numbers you want to count: what is their distribution over the numbers in the file?
If the distribution of numbers is random there's no knowledge you can take account in your algorithm. Then the solution is: read the file as quick as possible and build an internal array that holds the counts.
If you're looking for performance i would rewrite the file, because for each number you have to figure out what number it is. It would rewrite it to a binary file, each number in a 2-byte int, no line feeds. Saves space a make the program more quickly
You have a maximum of 10,000 numbers. An int array of 10,000 items is about 40k. Since every line is 6 bytes, you can read the entire file into memory, or you could create a read buffer of, say, 6k. Then write a simple algorithm to convert the numbers to binary. Use this number to increment the value at the index in the array.
I am a java guy. I am sorry if my below post sounds basic stuffs. Basically I am working for a project that has C++ back-end and Java in the front-end.
Currently developing a module that sends out an e-mail message (just plain text) to all recipients and/or group of recipients from Java GUI that uses C++ back end running on HP-UNIX to send mail using "sendmail" command via SMTP. After having spent quite a bit of time trying to figure out a way to get the delivery status back off of SMTP server (to display the status for each recipients in GUI), I have been unable to find a way to get this job done. I just piping the message (C++ code) to server that contains "sendmail" command along with address and message body.
I was hoping to find out - Is there a library api available for C++ to send mail via SMTP to make life easier? Or is there a simple C++ code that does this, basically I would have to get the delivery status for each recipients.
I am looking for something similar to CSMTPConnection v1.36[^] that I can use for HP-UNIX (I guess this was developed for Windows MFC) OR can I still use the same for C++ running on HP-UNIX as well ?
I would truly appreciate any input/suggestion on this.
As I said earlier - I am doing some enhancements to existing application that is built on C++ back end. So C++ not only sends mail out but also does other stuffs. I know that I can use Java to do this but I got to use C++ (Real Time server that runs on HPUX).
All am looking for is a way to read the response back from server that tells whether or not message is delivered.
just pumping it up guys - tried to google it - do find couple of library that does this for you but problem is that either got to pay for it or library with whole bunch of other stuffs that you got deal with. Could not help.
really looking for something simple ..c++ library api OR c++ code which is simple enough to send mail using sendmail command & tells the delivery status for each recipients.
I created an MFC application and added Printing and Print Preview capability to a CMyFormView derived from CFormView. The problem is that the "Prev Page" and "Zoom Out" buttons on the Print Preview toolbar are always disabled whether the second, third or last page is displayed. The "Next Page" button are always enabled and work correctly.
For the Prev Page button, I set CPrintInfo::SetMaxPage() and CPrintInfo::SetMinPage(). However, this doesnt work to enable the Prev Page button. In debug mode, I could see that CPrintInfo::m_nCurPage value was correct within OnPrint() method when the program is in print preview. Anybody knows how to enable Prev Page button in Print Preview dialog?
Last Visit: 31-Dec-99 18:00 Last Update: 2-Oct-23 2:39