Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

Help: Exception on update_cb()

Hi All,

 

I'm new to the forum so I hope I'm posting this question in the proper place.  Fairly new to NX programming as well so bear with me.

 

I'm getting an exception in my selection callback update_cb()

 

I only get the exception in NX 8.5 (9.0.1, 10, and 11 do not throw the exception).  Code is the same for each.

 

Despite the exception, the selected feature is still obtained.

 

The exception reads:  Unhandled exception encountered in callback automation code.

 

However, I've commented out all the code in update_cb() except for 

 

 

 

std::vector<NXOpen::TaggedObject *>selCompTags ;
NXOpen::BlockStyler::PropertyList *selCompProps =m_pSelection->GetProperties();
selCompTags = selCompProps->GetTaggedObjectVector("SelectedObjects");
delete selCompProps;

and the exception continues to be thrown.

 

I don't see any differences in the help docs for retrieving selected objects between 8.5 vs. 9.0.1, 10, & 11

 

Any ideas?

 

Thanks,

Victor

 

 

 

 

5 REPLIES

Re: Help: Exception on update_cb()

Victor,

 

I don't really see anything wrong with your code, but you could try calling GetSelectedObjects() on the selection block itself - without the PropertyList. (See attached picture from the 8.5 docs.)

 

Steve

Re: Help: Exception on update_cb()

Thanks, Steve.

 

Unfortunately I get the same exception using SelectObject::GetSelectedObjects()

 

I had to change our m_pSelection object from UIBlock type to SelectObject type in order to try your suggestion, but to no avail.

 

Can you think of anything else to try?

Re: Help: Exception on update_cb()

Victor,

 

Offhand, no, but I would encourage you to log an IR with GTAC, and then we can investigate more thoroughly.

 

We will probably want your .DLX file so we can test with it.

 

Thanks!

 

Steve

 

Re: Help: Exception on update_cb()

Will do.  Thank you for the help

Solution
Solution
Accepted by topic author vmonte01
‎01-13-2017 08:41 AM

Re: Help: Exception on update_cb()

The issue turned out to be the compiler version.  We were using VS2012 for our NX 9, 10, & 11 builds, but NX 8.5 does not support VS 2010. Switching the NX 8.5 build to use VS 2010 took care of the issue.

 

Thanks for the help!