Window handle -> associated data

Hi to all windows-programmers, who know about API-programming!

The situations:
I am writing a DLL, that contains a modal dialog. This dialog
gives the user the possibility to edit some data. The data has
to be stored somewhere, so that the DialogProc can access it.
If the possibility exists, that two applications call the
same DLL-Procedure at the same time, there have to be two sets of
this data - one for each dialog.
How do you folks solve this problem? If I store the data on the stack
of the calling program, I can not access it straight forward from
the DialogProc. My solution to this problem is a global array with
records, that contain the data (or pointers to the data on the stack)
and the window handle for the dialog that is associated with this
data. The DialogProc than has to search the array to find the right
Does anybody have a better (easier) idea? Any comments?

Stefan Bormann
eMail until june '96: