Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
blackdeng opened this issue Jul 31, 2024 · 0 comments
Open

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

blackdeng opened this issue Jul 31, 2024 · 0 comments

Comments

@blackdeng
Copy link

blackdeng commented Jul 31, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant