AnsweredAssumed Answered

Frequent errors with 2009 API

Question asked by Ricardo Talbot on Jan 19, 2009
Latest reply on Jan 21, 2009 by Ricardo Talbot
Our company is currently writing an add-in for SolidWorks Enterprise PDM but we keep encountering the same problem. All our code is in VB.NET with the Framework 2.0. When we call some functions from the EPDM API, we sometimes get a " System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt." exception.

Specifically, we mostly get this error when we try to read the BoM from a file with the GetComputedBOM function or when we try to access the variables with the GetVariable function from a IEdmVariableMgr6 object. The error is not consistent, sometimes the call to the functions will work and sometimes we will get an exception or the underlying process will simply crash with no exception thrown. We get the same problem with a simple custom application that reads the BoM of a chosen file.

When doing the tests, we were logged with the admin account on the EPDM vault and with an account on the computer with admin rights. We also seems to encounter the problem mostly when using a SolidWorks assembly file when trying to read the BoM or variables.

Anyone got any idea what would be causing this?