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
0
Question by steviewondrs · Apr 12, 2013 at 02:46 PM · c#dll64-bit32bit

x64 dll workaround

As most programmers nowadays only release their SDK's, API's or drivers in an x64 format I was wondering,... actually I really need to find a way to acces a x64 dll from the 32bit Unity platform. (using P-invoke)

I've been researching this problem for quite a while now, and going backwards (from 64 bit to 32 bit) doesn't seem to be a problem. But what if I want to go the other way? Is there some workaround for this problem?

P.S. Pointing out that a x64 Unity editor should be available isn't going to help, because the Unity team is getting pretty nervous about it

Comment
Add comment · Show 5
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 Graham-Dunnett ♦♦ · Apr 12, 2013 at 10:08 PM 0
Share

This is massively outside my area of expertise, but can you write some kind of 32-bit DLL that simply proxies from Unity through to your 64-bit DLL?

avatar image steviewondrs · Apr 17, 2013 at 01:02 PM 0
Share

I would have to write CO$$anonymous$$ objects. Or a socket based interface. I think that's way too much work for the few methods I need.

avatar image Yokimato · Apr 17, 2013 at 01:17 PM 0
Share

What happens when you try? Bring in the RunTime Interop namespace and declare your methods you're importing to invoke. You might have to adjust IntPtr.Size to 8 when you make your call. I'm interesting in hearing what errors (if any) you get.

A quick not about the pointer size. A pointer (which is basically a reference to a memory location) on 32-bit Windows is stored in 4 bytes i.e 4 x 8 = 32 bits. On 64-bit Windows it’s stored in 8 bytes i.e 8 x 8 = 64 bits.

avatar image steviewondrs · Apr 18, 2013 at 07:30 AM 0
Share

DllNotFoundExceptions... But I've tried building the project in x64. I can use the x64 dll when I put it inside the same folder as the .exe that is created. It's a $$anonymous$$or annoyance that I can't use the unity debugger to test my app with the dll, but it works.

avatar image siddartha_ · Feb 03, 2016 at 09:53 AM 0
Share

Hi. I know this is suuper old, but you mentioned it's easy to use a 32 bit dll from a 64 bit build? Can you provide any hints on this? Thanks!

0 Replies

· Add your reply
  • Sort: 

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

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

dll error when build 4 Answers

Any CPU DLL does not work in 64 bit editor 0 Answers

Using 2 DLLs with the same name 2 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