Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 13th, 2005, 11:26 AM   #1
Mark67
Newbie
 
Join Date: Jan 2005
Posts: 3
Rep Power: 0 Mark67 is on a distinguished road
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
Mark67 is offline   Reply With Quote
Old Jan 14th, 2005, 8:24 PM   #2
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
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.
Rory is offline   Reply With Quote
Old Jan 14th, 2005, 10:38 PM   #3
Mark67
Newbie
 
Join Date: Jan 2005
Posts: 3
Rep Power: 0 Mark67 is on a distinguished road
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
Mark67 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:01 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC