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: Determine OLE file type?
Topic Summary:
Created On: 10-Feb-2005 22:19
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 Antonio Norkus, on Wednesday, February 16, 2005 5:27 PM

Answer:
The attached function will return the class of the first OLE of the passed in attribute. Perhaps you can base your actions on this class type. The technique may be extended to handle objects with multiple OLEs.

The code shows an example of usage on the "Object Text" of the current object.

 10-Feb-2005 22:19
User is offline View Users Profile Print this message


Shawn Stepper

Posts: 96
Joined: 6-Aug-2004

I am working on exporting from DOORS, and need to be able to tell what type of file an embedded OLE is. If it is any type of image file, I want to paste it into Word as a PNG (using Paste Special...). But if it's an embedded file (Visio for example) I need to do a regular paste instead of a paste special. I have not found any way to determine the file type of an OLE. For embedded pictures, the DOORS built-in function works to determine file type, but nothing for OLEs.

Thanks!

Shawn

-------------------------
Shawn Stepper
shawn.e.stepper@wellsfargo.com
Report this to a Moderator Report this to a Moderator
 11-Feb-2005 08:42
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

Snap.

I have just been struggling with the same problem.
I spoke to Telelogic support and they told me that DOORS does not store any information about the OLE so there is no way to find out what the supporting application is.

My interim solution was to store the name of the supporting application in an attribute. This means that I can only have one OLE per object, but it does allow my exporter to run smoothly.

I toyed with the idea of activating the OLE and then looking to see what application had been launched using oleGetAutoObject(). This worked, but I didn't like doing things this way because it relies on the user not having any applications running when they do the export.


-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 11-Feb-2005 11:44
User is offline View Users Profile Print this message


Antonio Norkus

Posts: 109
Joined: 28-Jun-2003

Answer Answer
The attached function will return the class of the first OLE of the passed in attribute. Perhaps you can base your actions on this class type. The technique may be extended to handle objects with multiple OLEs.

The code shows an example of usage on the "Object Text" of the current object.



Edited: 11-Feb-2005 at 11:47 by Antonio Norkus
Report this to a Moderator Report this to a Moderator
 11-Feb-2005 12:29
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

Thankyou Antonio.

You have saved me a lot of hard work.

Why didn't I think of looking there?

I can now rewrite my exporter to use this information.

Now why couldn't doors support tell me that!



-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 14-Feb-2005 14:25
User is offline View Users Profile Print this message


Judith Underwood

Posts: 35
Joined: 25-Sep-2002

I'd recommend using a Buffer instead of string to hold the results of the call to richTextWithOle, or you will see your memory usage increasing very rapidly.

All the regexp functions should work on buffers as well as strings.
Report this to a Moderator Report this to a Moderator
 15-Feb-2005 20:01
User is offline View Users Profile Print this message


Shawn Stepper

Posts: 96
Joined: 6-Aug-2004

Thank you Antonio!

Attached is some modified code to use Buffers instead of strings, and to check for windows meta files, which do not have an objclass associated with them.


-------------------------
Shawn Stepper
shawn.e.stepper@wellsfargo.com
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 0 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 0 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.