11 Replies Latest reply on Dec 7, 2009 1:32 PM by 1-AWIBQU

    Get Computed BOM function error



      I am getting this error from GetComputedBom functions in EPDM API.


      Access violation exception

      Attempted to read or write protected memory. This is often an indication that other memory is corrupt.


      Complete error message -------

      System.AccessViolationException was caught
        Message="Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
             at EdmLib.IEdmFile7.GetComputedBOM(Object oBomLayoutNameOrID, Int32 lVersionNo, String bsConfiguration, Int32 lEdmBomFlags)    at EPDM_DESIGNLINK_ADDIN.CEPDM.bReadBomFromEdm(FSplash& frmSplash) in C:\Nalin\Visual Studio 2008 Projects\L3COM\DesignLink - Deploy error\VisualDesignLink - L3COM 64bit\EPDM_DESIGNLINK_ADDIN\Ulitily Classes\CEPDM.vb:line 168



      Anybody knows how to fix this one.


      I dont get this error all the time. For an example i have assembly file that have 5 configurations. GetcomputedBom function doesn't fire this error for 4 of them. But for one of the configurations this one pops up.


      I am using visual studio 2008 .NET framework 3.5, Visual basic.


      Please help



        • Re: Get Computed BOM function error
          Have you submitted this to your VAR or SolidWorks?  I have a feeling it's the API and not your code, and it's probably specific to x64.
            • Re: Get Computed BOM function error

              I have asked for the help from Solidworks API and this is the reply that i got.


              Dear Nalin,

              I am not sure at this point whether the problem with your code lies with the EPDM API. Unfortunately, It is not very convenient to debug the code that you have sent us. So I think it would be best if you could send us the entire assembly in which you are getting this error. I will then try to write a simple standalone application using which i will try and reproduce the problem.

              Also, looking at your code and the error message that you are recieving, I think it will be a good idea if you could check whether the variable "SelectedText" always carries a value when you call the GetComputedBom API. Please send me the assembly and I will try to reproduce the problem.


              Srinivasan Anandan

              Dassault Systèmes SolidWorks Corp. Technical Support


              For sure what i can say at the moment is that SelectedText is not emtpy. I have tested this many times and i am sure about this one. I have no rights to send the problem assembly to the api support as it belongs to the customer and i dont think that they would like to do it as well.


              The customer is running x64 bit and i am running x32. Both systems gives the same error.


              I am helpless at the moment and have no way of solving this. It is not predictable either. For an example if i change the name of the configuration then it works ad if i change the name of the configuration to the one that was not working thenit starts to work again. But i went on chaning configuration names and now it is not working for the names that it worked before. It's very difficult to predict this error.


              Anybody who have faced this issue and have managed to solve this one or have a workaround for this please help.


              Your help is greatly appreciated.