Skip to content

Loading failed with "marshaling conversion 22 not implemented" #186

@blackdeng

Description

@blackdeng

I'm integrating the Image3dAPI and the GE loader to a Unity project. Based on the TestViewer example, it looks like the Image3dAPI can be integrated as a managed plugin to Unity. I was able to retrieve information such as the bounding box, and frame count in my Unity C# code, but when I try to access the data using GetFrame, an exception was thrown "marshaling conversion 22 not implemented". Further stack trace attached below:

  at (wrapper managed-to-native) Image3dAPI.IImage3dSource.GetFrame(intptr,uint,Image3dAPI.Cart3dGeom,uint16[],Image3dAPI.Image3d&)
  at (wrapper cominterop) Image3dAPI.IImage3dSource.GetFrame(uint,Image3dAPI.Cart3dGeom,uint16[])
  at (wrapper cominterop-invoke) Image3dAPI.IImage3dSource.GetFrame(uint,Image3dAPI.Cart3dGeom,uint16[])

It seems the exception is because Unity C# uses Mono scripting backend which does not support SAFEARRAY in runtime. All APIs that return SAFEARRAY failed in Unity (returns null instead). Would it be possible to use a alternative type for arrays so that the library can be used in Unity?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions