Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by zharramadar · Feb 25, 2013 at 01:13 PM · c#interopcom

Unity and ComImport

Hi,

I'm trying to use ComImport to import a COM+ Interface into Unity and call methods forth and back. The declaration is:

 [ComImport, Guid("1A00A7BA-C217-11E0-AC90-0024811441FD"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
     internal interface IFTFaceTracker


But for some reason, as soon as I try to ComImport anything, Unity crashes. Anyone has any idea on why, and if Unity is even capable of ComImport? My target deployment environment is only Standalone Windows.

-Roger-

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Valynx · Mar 22, 2013 at 09:45 PM 0
Share

I am wondering the same thing for a project I'm working on. Have you had any luck?

avatar image zharramadar · Mar 25, 2013 at 07:59 PM 0
Share

Not at all. I even asked Unity about it, but got no reply from them. What I made now is to make a new .NET Framework 4 application, and used named pipes (could use socket too) to bring data back/forth Unity app. Dumb workaround, but I need to go on, as it seems no one, not even at Unity, knows how to solve it, or even inform if this is not supported by their implementation of $$anonymous$$ono (I'm use 2.6.x version of $$anonymous$$ono in their site can do it perfectly, I tested.)

avatar image Graham-Dunnett ♦♦ · Mar 25, 2013 at 09:38 PM 0
Share

@zharramadar - what was the support case number? $$anonymous$$y $$anonymous$$m respond to all enquiries, so would be good to look into your case and see what happened.

avatar image DMGregory · May 03, 2014 at 09:25 PM 0
Share

I'm experiencing this same issue (same library, even) - has anyone found a way around this other than running a separate .NET application and using inter-process communication to shunt the data across?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Cygon4 · Apr 04, 2013 at 09:19 PM

I'm using ComImport in Unity 4.1.0 to query the Saved Games folder on Windows systems and I have not noticed any problems so far.

You can find the code I'm using for this in the Unify Community Wiki: Windows Saved Game Directory

If that also crashes Unity for you, it would seem likely that the problem depends on something in your environment. I could imagine that Unity's web player would have trouble because Microsoft has added lots of barriers to calling COM from a browser due to security concerns.

Correction: This only works in the Editor for me. In the standalone player, the first cast (`QueryInterface()`) from COM object to interface fails, just as it would happen if all COM-specific attributes were simply ignored.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

13 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Interop Kinect FaceTracking FT_SENSOR_DATA 2 Answers

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Flip over an object (smooth transition) 3 Answers

Simplest way to call c# code from Unity and hook events 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges