Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Some Troubles with OleAutoObj
Topic Summary:
Created On: 20-Mar-2007 13:47
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
Answer This question was answered by Lars Johannknecht, on Tuesday, March 20, 2007 4:30 PM

Answer:
First I have to thank everybody for all the hints.

@Reik:

Thank you in particular. You gave the right hint.
Now it works.
COM Object handling is sometimes a little bit confusing within DXL

Best Regards
Andreas
 20-Mar-2007 13:47
User is offline View Users Profile Print this message


Lars Johannknecht

Posts: 4
Joined: 15-Oct-2002

Hi all,

first, I want to show you the equivalent and expected results in Python:

------ Py Start -----
[Dbg]>>> Entities = Browser.GetSelectedEntities()
[Dbg]>>> Entities.Count
1
[Dbg]>>> Entity = Entities.Item(1)
[Dbg]>>> print Entity.Name
DOORS00000141
[Dbg]>>>
----- Py End -----

The DXL equivalent looks like this, hopefully without errors
---- DXL Start ----
79 clear(autoArgs)
80 print "Ents: " oleMethod(Browser, "GetSelectedEntities", autoArgs, AssocEnts) "\n"
81 print "EntCount: " oleGet(AssocEnts, "Count", x)
82 print " " x "\n"
83 clear(autoArgs)
84 put(autoArgs, 1)
85 print "Ent:" oleMethod(AssocEnts, "Item", autoArgs, AssocEnt) "\n"
86 print "Ent.Name:" oleGet(AssocEnt, "Name", strRet) "\n"
87 print strRet "\n"
88 halt
---- DXL End ----

DXL stops with this error message:

Ents:
EntCount: 1
Ent: OLE failure: Mitglied nicht gefunden. //(Member not found)

-R-E- DXL: null OleAutoObj parameter was passed into argument position 1
-I- DXL: execution halted

I've tried many ways to reach single objects of the associated entities collection object,
but everything went wrong. I've no idea.

We are running DOORS 8.1

Best Regards and many thanks in advance
Andreas

Edited: 20-Mar-2007 at 15:52 by Lars Johannknecht
Report this to a Moderator Report this to a Moderator
 20-Mar-2007 14:02
User is offline View Users Profile Print this message


Paul Tiplady

Posts: 176
Joined: 28-Oct-2003

I took ages getting hold of each table in a Word document in turn, which looks like a very similar problem. The function attached did it for me -- maybe it will help you!

The various contants are:

cPropertyTables = "Tables"
cPropertyCount = "Count"
cMethodItem = "Item"
wdAutoFitContent = 1
cMethodAutoFitBehavior = "AutoFitBehaviour"

Cheers,
Paul.

-------------------------


Paul dot Tiplady at TRW dot com
TRW Automotive
Report this to a Moderator Report this to a Moderator
 20-Mar-2007 15:50
User is offline View Users Profile Print this message


Reik Schroeder

Posts: 361
Joined: 28-Jul-2003

Hi Lars,

I have not read the documentation about the used Browser OLE-object, but may be the
selectedEntities object has an Item property instead of an Item method
so your code would change into:

85 print "Ent:" oleGet(AssocEnts, "Item", autoArgs, AssocEnt) "\n"

I've seen this problem somewhere in MS Office automation but did not remember exactly where.

Hope that helps you,

Greetings
Reik

-------------------------
Evosoft GmbH
for Siemens Industry Sector


Berlin, Germany
Report this to a Moderator Report this to a Moderator
 20-Mar-2007 16:30
User is offline View Users Profile Print this message


Lars Johannknecht

Posts: 4
Joined: 15-Oct-2002

Answer Answer
First I have to thank everybody for all the hints.

@Reik:

Thank you in particular. You gave the right hint.
Now it works.
COM Object handling is sometimes a little bit confusing within DXL

Best Regards
Andreas
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 2 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 2 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.