Solved

OLE Automation Object hierarchy

Posted on 1997-10-31
4
176 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

744 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now