![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jan 2005
Posts: 3
Rep Power: 0
![]() |
Getting parent forms object
Hi,
Does anyone know how I can get to the parent forms object collection from within an activeX dll similar to an ocx's UserControl.Parent property? I'd like to get the parent forms collection without having to pass this argument from a sub. Thanks, Mark |
|
|
|
|
|
#2 |
|
Expert Programmer
|
ActiveX DLL Parent
Because VB DLL's subclassing is "emulated" (i.e. the parent-child heirachy is not provided by windows as for a control on a form) there does not seem to be any direct method of accessing the parent's object collection, without the child process (DLL) being passed a pointer (byref collection) by a sub from the parent (as you said). I found this when trying to program ActiveXDLL Documents for IE that re-sized to the container height: because IE like many host applications does not expose its objects to clients, the only way I could simply get the window dimensions was by cheating using the GetWindowParent API.
Maybe someone else here can cast some light on the matter. |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Jan 2005
Posts: 3
Rep Power: 0
![]() |
Thanks for the info Rory. I have thought about GetWindowParent but it would still leave me with only a handle, which can't be converted back to a 'form object' and I needed to access and manipulate the calling forms object collection without doing it in API as I already had about 4 class modules(large) and 6 basmodules that have form.left etc etc.... all the way through them. I couldn't figure out how to do all of that without passing the form collection so I have since converted it all to API and now pass the winHandle of the form on Form_Load()
Mark |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|