Click here to Skip to main content
15,949,686 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow do i Detect if an external program has finished excuting(shellexec)? Pin
Member 40481330-Jun-03 20:35
Member 40481330-Jun-03 20:35 
AnswerRe: how do i Detect if an external program has finished excuting(shellexec)? Pin
Toni7830-Jun-03 20:44
Toni7830-Jun-03 20:44 
AnswerRe: how do i Detect if an external program has finished excuting(shellexec)? Pin
Rage30-Jun-03 20:48
professionalRage30-Jun-03 20:48 
AnswerRe: how do i Detect if an external program has finished excuting(shellexec)? Pin
cmk30-Jun-03 20:52
cmk30-Jun-03 20:52 
GeneralChecksum Pin
Toni7830-Jun-03 19:27
Toni7830-Jun-03 19:27 
GeneralRe: Checksum Pin
Michael Dunn30-Jun-03 19:52
sitebuilderMichael Dunn30-Jun-03 19:52 
GeneralRe: Checksum Pin
Toni7830-Jun-03 20:04
Toni7830-Jun-03 20:04 
GeneralRe: Checksum Pin
kakan30-Jun-03 20:03
professionalkakan30-Jun-03 20:03 
The "normal" way to do it is this:
1.
Write your program, which includes your checksum algorithm.
2.
Put in a constant string of a known length. This string must have an unique identifier (which can later be found, browsing through the exe file).
I.e. "____xyz____zyx____AAAA".
(This string is 22 bytes long + the null, making it 23.)
The "AAAA"-part is later gonna be replaced with the real checksum code (assuming that the checksum will be 4 bytes long).

3.
Write the check code (still in your program), working like this:
Open the exe file, read through it and calculate the checksum, but DON'T count the constant string! Instead, when the string is found, read the "AAAA"-part and interpret it as an integer (likely an unsigned int, depending on the checksum algorithm). Close the exe-file.

4.
Compare the calculated checksum with the checksum from the "AAAA"-part. If a match, the it is OK.


5.
Write another program, a;) checksum generator (re-use the code in step 3), but this time, when the ID is found, save the file offset to the "AAAA"-part. (Remember, don't count the ID-string!)
When the checksum is calculated, seek to the saved offset to the "AAAA"-part, convert the checksum to a string, and write it to the exe-file.

Of course, you must recalculate the checksum every time you compile your program.

Good luck.
kakan

GeneralRe: Checksum Pin
Toni7830-Jun-03 20:15
Toni7830-Jun-03 20:15 
GeneralRe: Checksum Pin
kakan30-Jun-03 20:19
professionalkakan30-Jun-03 20:19 
GeneralWin2K : AcceptEx() & getpeername() Pin
cmk30-Jun-03 17:52
cmk30-Jun-03 17:52 
GeneralRe: Win2K : AcceptEx() & getpeername() Pin
Ryan Binns30-Jun-03 18:52
Ryan Binns30-Jun-03 18:52 
GeneralRe: Win2K : AcceptEx() & getpeername() Pin
cmk30-Jun-03 21:06
cmk30-Jun-03 21:06 
GeneralRe: Win2K : AcceptEx() & getpeername() Pin
Ryan Binns30-Jun-03 22:14
Ryan Binns30-Jun-03 22:14 
GeneralRe: Win2K : AcceptEx() & getpeername() Pin
cmk1-Jul-03 8:41
cmk1-Jul-03 8:41 
GeneralRe: Win2K : AcceptEx() & getpeername() Pin
Ryan Binns1-Jul-03 15:39
Ryan Binns1-Jul-03 15:39 
GeneralRe: Win2K : AcceptEx() & getpeername() Pin
cmk1-Jul-03 17:08
cmk1-Jul-03 17:08 
Questionhow to get the current window system language name? Pin
benben30-Jun-03 17:35
benben30-Jun-03 17:35 
AnswerRe: how to get the current window system language name? Pin
Toni7830-Jun-03 18:14
Toni7830-Jun-03 18:14 
AnswerRe: how to get the current window system language name? Pin
Ryan Binns30-Jun-03 18:58
Ryan Binns30-Jun-03 18:58 
GeneralRe: how to get the current window system language name? Pin
Toni7830-Jun-03 19:12
Toni7830-Jun-03 19:12 
GeneralRe: how to get the current window system language name? Pin
Rage30-Jun-03 20:51
professionalRage30-Jun-03 20:51 
GeneralRe: how to get the current window system language name? Pin
Ryan Binns30-Jun-03 22:03
Ryan Binns30-Jun-03 22:03 
GeneralThanks Pin
benben30-Jun-03 20:39
benben30-Jun-03 20:39 
GeneralRe: Thanks Pin
Ryan Binns30-Jun-03 22:04
Ryan Binns30-Jun-03 22:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.