I am trying to ascertain whether a process running in a separate .exe, not just a separate thread, has completed (multithreading is not an option in this case). In the calling module, the following code executes:
volatile bool* IsDone = new bool;
*IsDone = false;
PostMessage(IndexWin, WM_INDEXER_PURGE_INDEX, (int)(IsDone), 0);
while(!(*IsDone))
{
Sleep(250);
Application->ProcessMessages();
}
So, we make a volatile bool (so it can be changed asynchronously), set it equal to false, and post a message to the other module using the pointer to the bool as the WPARAM. We then process messages until the other module
sets the bool equal to true.
In the other module, the following code is run:
volatile bool* IsDone = (bool*)Msg.WParam;
*IsDone = true;
I get an access violation from the second module when it tries to change the bool's value (writing to whatever address). Why? Is there a way to pass a pointer this way?
~BenDilts( void );
~BenDilts( void );
benbeandogdilts@cs.com
volatile bool* IsDone = new bool;
*IsDone = false;
PostMessage(IndexWin, WM_INDEXER_PURGE_INDEX, (int)(IsDone), 0);
while(!(*IsDone))
{
Sleep(250);
Application->ProcessMessages();
}
So, we make a volatile bool (so it can be changed asynchronously), set it equal to false, and post a message to the other module using the pointer to the bool as the WPARAM. We then process messages until the other module
sets the bool equal to true.
In the other module, the following code is run:
volatile bool* IsDone = (bool*)Msg.WParam;
*IsDone = true;
I get an access violation from the second module when it tries to change the bool's value (writing to whatever address). Why? Is there a way to pass a pointer this way?
~BenDilts( void );
~BenDilts( void );
benbeandogdilts@cs.com