Solved

OLE Automation Object hierarchy

Posted on 1997-10-31
4
179 Views
Last Modified: 2013-11-20
I am having difficulties in implementing a hierarchy or objects.  My class implements three tiers of objects.  The root item is called Collections.  Under that I have several collections.  Funds and Regions being two of them.  I've implemented an enumerator and this works fine.  My problem is that when using my class in VB (as a referenced object), the auto method list box which shows up when editing code only displays my root objects methods and properties.  Even when I select the Fund method of the root object.

This is in contrast to other objects such as Excel which will navigate the chain right through from Application.Workbook.Sheets etc.  I've obviously missed some property that other objects use.
0
Comment
Question by:dhodge
  • 2
4 Comments
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1309110
I think VB is using the type libraries for that information. In addition make sure the objects you have declared in VB are of the right type and not OBJECT. A generic object in VB will not have any type information associated with them.
0
 
LVL 2

Author Comment

by:dhodge
ID: 1309111
Thanks but, I've created the type library and pointed VB to it, and the objects are defined correctly.  Can you think of anything else?
0
 
LVL 1

Accepted Solution

by:
dkremer earned 100 total points
ID: 1309112
Hi.
I'm not sure I understand your structure - Funds is a member of Collections or is it a member of an item in Collections ? but it doesn't matter. In your source code the Funds function should return LPDISPATCH (which VB translates as an Object), but in the ODL or IDL file the Funds method definition should return IFunds* or whatever you call the Funds interface, otherwise VB expects an oject and won't show it's list of member methos and properties.
Hope this helps.
 
   - Dror Kremer
0
 
LVL 2

Author Comment

by:dhodge
ID: 1309113
Thanks for that, I've tried it and it works fine.  You've saved me a great deal of time.
0

Featured Post

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question