Solved

OLE Automation Object hierarchy

Posted on 1997-10-31
4
183 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…

707 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