|
see my edit above =) think that is your issue... i was barking up the wrong tree
|
|
|
|
|
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 !!
Doug
|
|
|
|
|
oh crap. so your saying that there is no registry edit applicable on your target network disk?
i would have thought that if there is no "server" so to speak of then the client side registry would be altered? but then again who said logic plays a part in software development haha
|
|
|
|
|
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 ...... !
Doug
|
|
|
|
|
Hi,
a quick look at the code shows that the handle will not be closed.
From MSDN:
When the handle is no longer needed, it can be closed by using the FindCloseChangeNotification function.
So I guess the error will show up after the loop has been executed a few times?
Regards
Frank
|
|
|
|
|
Hi Frank, Getting the problem whilst single-stepping in the debugger !
Doug
|
|
|
|
|
I got the same problem as you have, but never found a solution. Thaught then that it was because i use Linux with Samba as the networkserver.
Rozis
|
|
|
|
|
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..........? )
My Src Code --
# define MAX_TP_DATA_BYTES 60
typedef struct
{
sHeader Header;
unsigned char Data[MAX_TP_DATA_BYTES];
} sPacket;
I have pointer to packet *psPAcket
Than I have an array called
unsigned char ArrayData[MAX_TP_DATA_BYTES];
No what I am trying to do here is I am assigning the "Data" information in struct "sPacket.Data" to "ArrayData".
ArrayData = psPacket->Data; --- and this where its giving me error.... am I dng somehtign wrong...
Plz can anyone help me....
THanks!!!!!
|
|
|
|
|
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 .
memcpy_s(ArrayData, MAX_TP_DATA_BYTES, ps->Data, MAX_TP_DATA_BYTES);
Kelly Herald
Software Developer
|
|
|
|
|
Greetings - and thank you for your consideration.
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:
6532
7737
9478
1239
7737
etc.
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.
Thank you Gary
|
|
|
|
|
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
Rozis
|
|
|
|
|
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.
|
|
|
|
|
You could create an object of std::map<int, int=""> where the first int (key) is a number in the file and the second int (value) is the count.
After extracting each number from the file, check if it exists in the map.
If the number is found, increment its value, otherwise create a new entry.
Then you can iterate the map to get the count of each number.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hello Gurus,
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.
Many thanks!
-RD
|
|
|
|
|
If you understand the concept of sockets if could send you some code the can be ported to C++...
But i was wondering: I guess there's a SMTP-class in Java - why not use that one?
Rozis
|
|
|
|
|
Thanks!
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.
Any help would be greatly appreciated!
Thanks,
RD
|
|
|
|
|
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 really appreciate any inputs or suggestions...
-RD
modified on Monday, July 27, 2009 5:09 PM
|
|
|
|
|
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?
Thanks
Sheng
|
|
|
|
|
Hi all,
I'm trying to find an alternative to GDI and GDI+ for simple 2D games since it doesn't look like GDI/GDI+ are made for that (having flicker issues with GDI+).
I plan on using bitmaps and animating them. I heard of SDL and Allegro. Anything else out there I'm missing? In your experience, which do you prefer?
My language of choice is C++.
|
|
|
|
|
Adassus wrote: Anything else out there I'm missing?
Whats wrong with DirectX[^]?
Best Wishes,
-David Delaune
|
|
|
|
|
Adassus wrote: having flicker issues with GDI+
Perhaps use two buffers one to show and one to draw and then swap them:
- with GDI use CMemDC[^]
- with OpenGL use SwapBuffers[^]
- for an alternative GUI framework see QT[^]
/M
|
|
|
|
|
I came across so many checksum calculation but I need to implement the checksum as below
I have packet coming in of 60Words , 2W and 256W and for all this I need to verify checksum with checksum present in the header of each packet... the algorithm that has been recommended as below.....
Mod 128 sum of all the 4-bit nibbles in the packet. Checksum field set to zero prior to calculating .... I dont understand thi can someone help me out
THANKS!!!!
|
|
|
|
|
Just study what the & | ~ << and >> operators ar for.
We don't do class assignmetns.
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
Extract 4 bits from each byte using bitwise operations.
Look at this Bitwise operation[^] link on how it can be done.
Divide this number by 128 and take its remainder.
You can use the % operator for this.
Add all the remainders together to get the checksum.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Dear all,
In Vista one can manually set a process virtualised using the taskmanager and right clicking the process, next setting it virtualised.
I need a little program starter (for ease of use lets call this startvirtualised.exe) which can be passed a location of a program (e.g. C:\Program Files\Example.exe).
The code I woul dlike to have should
a) Start the process "C:\Program Files\Example.exe
b) Set the TokenVirtualizationEnabled
c) Exits
Thanks in advance, I would pay for the time it would need to code this
|
|
|
|