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: Function causes Exception_access_Violation
Topic Summary: Function is successful but causes violation
Created On: 23-Sep-2008 20:29
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.
 23-Sep-2008 20:29
User is offline View Users Profile Print this message


Mark Williamson

Posts: 79
Joined: 12-Sep-2005

Hi All,

Previously I had a DBE being populated by a fixed string in the form string plat[] = {"A","B","etc"}. This was working fine for various DBE populations.

Unfortunately, the range of selectable values within the choice DBE needs to be dynamic therefore I have written a script attached below to extract the enumeratations of the data type in question and populate the DBE choice accordingly. After much experimentation this works and the choice DBE is populated with the enumerations of the required attribute.

The problem is that even though the dxl seems to be doing its job, every time the function is called, an exception access violation is triggered with a diagnostic log.

Been pulling hair out for two days. Can anyone point me in the right direction. I need to do a similar function for several other attributes so this is becoming a real issue.

Thanks in advance

Mark

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

mark_williamson@synthesys.co.uk
http://www.synthesys.co.uk
----------------------------------------
Report this to a Moderator Report this to a Moderator
 23-Sep-2008 21:42
User is offline View Users Profile Print this message


Douglas Zawacki

Posts: 58
Joined: 17-Oct-2006

I don't see plat defined anywhere in the code. What is the data type/size of the plat[]....? You cannot exceed the defined size.

If you are trying to populate a DBE with dynamic data, don't populate an array. Insert the data into the DBE itself.

Edited: 23-Sep-2008 at 21:44 by Douglas Zawacki
Report this to a Moderator Report this to a Moderator
 23-Sep-2008 22:11
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Yet another example of Autodeclare messing someone up.

Sounds like you need to get the number of enumerations in the attribute, IIRC its 'size', and declare string plat[Size].

- Louie
Report this to a Moderator Report this to a Moderator
 23-Sep-2008 22:24
User is offline View Users Profile Print this message


Mark Williamson

Posts: 79
Joined: 12-Sep-2005

Douglas and Louie,

There are currently only 4 enumerations of the attribute type in question and I have declared string plat[100] = {}.

Have just tried initialising with plat[4] and the exception is cleared. I need to figure out how to dynamically initialise the array or as Douglas has suggested populate the DBE directly. As a DXL newbie I was under the impression that the DBE values had to specified from within an array.

Many thanks

Mark

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

mark_williamson@synthesys.co.uk
http://www.synthesys.co.uk
----------------------------------------
Report this to a Moderator Report this to a Moderator
 24-Sep-2008 08:43
User is offline View Users Profile Print this message


Reik Schroeder

Posts: 361
Joined: 28-Jul-2003

Hi Mark,

your problem can be solved a little bit easier
See attched code for example.

Be carefull with using local string arrays for initializtion of DBEs.
I mostly use empty parameters of creation of DBE, then "realize" the dialog box
and then fill it with values. That will support an easier way for updating the dialog.

Hope that helps you.
Greetings
Reik

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


Berlin, Germany
Report this to a Moderator Report this to a Moderator
 24-Sep-2008 11:44
User is offline View Users Profile Print this message


Mark Williamson

Posts: 79
Joined: 12-Sep-2005

Hi Reik,

Thanks a lot for your posting. I have spent all morning reviewing your code snippet and think I understand how it works. I have rehashed my dxl to implement the method and it seems to be working ok. Unfortunately the tentacles are spreading and each script seems to generate more.

Thanks

Mark

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

mark_williamson@synthesys.co.uk
http://www.synthesys.co.uk
----------------------------------------
Report this to a Moderator Report this to a Moderator
 25-Sep-2008 17:03
User is offline View Users Profile Print this message


Douglas Zawacki

Posts: 58
Joined: 17-Oct-2006

Mark,

Not sure what you mean about the tentacles but I thought you might benefit from seeing a simple code snippet of dynamically inserting data into a choice DBE. So, at least you have an alternative approach. Hope this helps. If you are still getting exceptions I might suggest to divide and conquer. Just cut out pieces of code until you stop getting the exception.
Report this to a Moderator Report this to a Moderator
 26-Sep-2008 10:31
User is offline View Users Profile Print this message


Mark Williamson

Posts: 79
Joined: 12-Sep-2005

Hi Douglas,

Thanks for the snippet. I have managed to get the choice DBE dynamically populated from the enumerated data type. What I meant by "tentacles" was that the more dxl I write, the more I realise how much there is to learn. I do not find the DXL reference manual particularly helpful in many cases and there does not seem to be any alternative manuals or guides available.

Thanks

Mark

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

mark_williamson@synthesys.co.uk
http://www.synthesys.co.uk
----------------------------------------
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 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 1 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.