why does data in my GetMsgProc in my DLL get set to 0xfffffffff outside it's own thread?
Posted on 2000-02-18
I've made a DLL which contains has an init func that sets a windows hook to receive messages (WH_MESSAGE).
The GetMsgProc only cares about WM_CHAR messages (the purpose of the dll is to monitor input for a particular string) but receives messages from all threads.
i've got a struct in the dll:
// the string we looking for
and an array of these suckers (MAXSTRING is 20 btw):
I use a basic window derived from CWnd to call the dll func that sets the hook and when i type characters inside that window the data such as
exists and i can send it to a file using
myfile << searchString[i].hunted << endl;
however when i change focus to another window like netscape the characters are still read from the keyboard and my GetMsgProc is called but the data inside the SEARCHSTRING struct is 0xffffffffffffff when i print it out.
what goes on? how can i set up my dll so that other threads can access the dll's global variable?