ocliff Level: Guest

|
Share variables between application and ActiveX-control in VB6
Hi,
I have an application (vb6) where you can create polygons and such on a picturebox. Now I have converted the picturebox to be a picturebox in an ActiveX-control, so that I can reuse it in different places in the application. I have defined some own types in a class in the control. In the main application I have created variables of these types and I pass them to the control for drawing.
I have read here that you should not pass the variables as variants/objects, but this is the only way it will work. The problem is that when I pass the variable (byref) the control creates a copy. Since there can be a lot of polygons to draw, this seems to be a not-so-clever solution.
The application and the control should in some way just share the variables. Is this possible in VB6? I want to pass the variable byref and then the activex should actually use that variable and not a local copy.
|