[CONNECT C#] CreateCellElement1 AddElements Arrays causes .NET application to crash

Hello,

I am working on OpenCities Map Enterprise CONNECT Edition Update 6 Version 10.06.01.02.

I am having issues with these two functions, CreateCellElement1 and AddElements. When passing the arrays of elements the application throws an error.

Ex.Message

Invalid callee. (Exception from HRESULT: 0x80020010 (DISP_E_BADCALLEE))

Ex.Source

Bentley.Interop.MicroStationDGN

Ex.StackTrace

   at Bentley.Interop.MicroStationDGN.Application.CreateCellElement1(String Name, Element[]& Elements, Point3d& Origin, Boolean IsPointCell)

Originally had this application running on MicroStation v8i. I use these two functions to draw the elements in groups. After converting to OpenCities and swapping out all the dlls the application throws an error on these two functions. I am able to draw each element individually without any issues. The strange thing is sometimes the functions executes properly, however most of the time they do not. I am using .NET Framework 4.7.2.

Any assistance or guidance would be greatly appreciated. Thank you.

Parents Reply Children
  • I built my application under both 4.6.2 and 4.7.2 and the same issue occurs.

    It's good to know. Even when the difference between the version is minor and should typically not cause any problems, it's always better to target exactly the same NET Framework version.

    Anytime I call CreateCellElements1() or AddElements() the error message is thrown.

    Sorry, but this is not code!

    It seems you try to discuss two different issues, because the two mentioned methods do different things. Also the context is very different.

    It's recommended to do not mix more issues into one topic, because in discussion it's not typically clear what exactly is discussed.

    CreateCellElements1()

    The method takes a cell from library. Do the library and the cell exist?

    AddElements()

    I would say it's probably bug (especially when AddElement() works. But again, it would be nice to see the code.

    the error message is thrown

    Did you try the same methods in VBA? (because it may help to distinguish whether it's e.g. bug in implementation)

    Exists both errors in any workspace? (because how cells are treated by DSF depends on workspace and XFM configuration)

    Did you try to create and analyze memory dump? (in this case probably the max one, including managed heap)

    Is it possible to try the same code with the latest OCM CE Update 7?

    Regards,

      Jan