wave
Mar 2nd, 2003, 05:05 AM
I am developing a pseduo random number generator (a C DLL called by VB) based on keyboard and mouse timing data being recorded in a table called g_entropyPool (Program source attached). The table
together with control fields are collectively defined in a separate segment.
Everything works fine if the activities are carried out within the called VB program window. Otherwise, the timing data will be recorded in two separate streams as follows:
Event Sequence:
1. VB Window activity
VB g_entropyPool "t1 00 00 00 00 00"
Other g_entropyPool "00 00 00 00 00 00"
2. VB Window activity
VB g_entropyPool "t1 t2 00 00 00 00"
Other g_entropyPool "00 00 00 00 00 00"
3. Other PGM Window activity
VB g_entropyPool "t1 t2 00 00 00 00"
Other g_entropyPool "00 00 t3 00 00 00"
4. VB Window activity
VB g_entropyPool "t1 t2 00 t4 00 00"
Other g_entropyPool "00 00 t3 00 00 00"
It seems there are two separate data segment instances. However, the next position to be added to the pool is bundled within the segment and two separate segment cannot achieve the result of step 3 above.
Please help.
Furthermore, does the problem relate to defining segment to be SHARED as marked Q1 in source and how?
What is the purpose of Q2 in source?
Thank you.
together with control fields are collectively defined in a separate segment.
Everything works fine if the activities are carried out within the called VB program window. Otherwise, the timing data will be recorded in two separate streams as follows:
Event Sequence:
1. VB Window activity
VB g_entropyPool "t1 00 00 00 00 00"
Other g_entropyPool "00 00 00 00 00 00"
2. VB Window activity
VB g_entropyPool "t1 t2 00 00 00 00"
Other g_entropyPool "00 00 00 00 00 00"
3. Other PGM Window activity
VB g_entropyPool "t1 t2 00 00 00 00"
Other g_entropyPool "00 00 t3 00 00 00"
4. VB Window activity
VB g_entropyPool "t1 t2 00 t4 00 00"
Other g_entropyPool "00 00 t3 00 00 00"
It seems there are two separate data segment instances. However, the next position to be added to the pool is bundled within the segment and two separate segment cannot achieve the result of step 3 above.
Please help.
Furthermore, does the problem relate to defining segment to be SHARED as marked Q1 in source and how?
What is the purpose of Q2 in source?
Thank you.