Kbase 19483: ACTIVEX - Insights on Using the Same OCX in Multiple Windows
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  04/02/2000 |
|
Customers have asked what happens when you use the same OCX in multiple windows within the same Progress session. There are several different levels to the answer (i.e. the answer depends on how the OCX was written) and they are as follows:
1. The number of times that the OCX/DLL file gets loaded is, of
course, only 1. If you use something like Microsoft's "Process
Viewer" that comes with Developer's Studio (or the similar
freeware "PrcView" ) and look at the modules loaded by
prowin32.exe, you'll see just one instance of the OCX,
regardless of how many of that particular control are currently
being used in the program.
2. There *WILL* be a separate copy of most if not all of the
control's DATA for each instance of the control that the program
uses. So if you have 2 windows with the control, or even just 1
window with 2 instances, and the control has a property or some
internal data, the values of the property/data for 1 instance of
the control will be independent of the values for the other, even
if both windows are open at once.
3. HOWEVER, it is possible to write a control that has some "static"
data that is shared by all instances of the control that are in
use. This is not typically what you'd want to do, but if there
were some reason that the author of the OCX needed to limit the
total number of something in 1 program, it could be done.