Solved

C#  64 bit dll, can it be called somewhay by a 32 bit dll or exe

Posted on 2013-11-05
9
703 Views
Last Modified: 2014-02-05
Helping a friend out.
They have 64 bit dll's that the need another application to use.
Other application is all 32 bit and we cannot change the dll's to build for all CPU's

32 bit is all vb.net in the same framework

I was thinking about  having a com explosed dotnet class call the 64 bit. dll and then the com plus exposed could be called by other 32 apps.

Also considered late binding.

any ideas?
0
Comment
Question by:hainansyndrome
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 39626370
Hi hainansyndrome;

Please read this post, it will answer your question.

So, after all, can 32bit code call into 64bit code?
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 39626508
First off I would say no.
You could try your idea but be prepared for a lot of effort for no return.

Having said that the question sounds very strange:  
As 64 bit dll's (as far as I know) will not function on a 32 bit operating system this means that all the target operating systems must be 64 bit.  So just changing the build to 64 bit will make no difference to the operating systems you target and solve this problem in one (trivial) step.
0
 

Author Comment

by:hainansyndrome
ID: 39627057
the operating system is a 64 bit one, just has 32 bit dll's in it
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
LVL 44

Expert Comment

by:AndyAinscow
ID: 39627076
Do you understand me?
32 bit dll's will function within a 64 bit operating system.
As far as I know 64 bit dll's will not run within a 32 bit operating system.

So, if your app is to use a 64 bit dll then it can only work on 64 bit operating system.  So why not just build it as 64 bit.
0
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 39627124
Hi hainansyndrome;

Did you read the link I posted?
0
 

Author Comment

by:hainansyndrome
ID: 39629150
its a 64 bit environment with 2 dll's
a 32 bit and a 64 bit

I need to figure a way to get a 32 bit dll to call a 64 bit dll.
0
 
LVL 63

Accepted Solution

by:
Fernando Soto earned 220 total points
ID: 39629227
Hi hainansyndrome;

Each application that is built runs in a Application Domain which isolates the application from all other application so that each application can't adversely affect each other. This application domain runs in a 32 bit or 64 bit but can not have both in the same app domain. Using a com interface is the same thing so you can not use comm as you stated in your opening question. Now that said it is possible for a 32 bit and a 64 bit applications to talk to each other but you would need to build an app around each DLL one being a 32 bit and the other being 64 bit and have them communicate through a technology such as IPC, Interprocess Communications,  DCOM, Distributed Component Object Model, Remoting, and other such technologies. But in no way can they both be in the same application Domain, same program.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 39629431
I agree with FernandoSoto, what you are wanting to do is very complex.

edit - I missed the last author comment.

The simplest is to build this 32 bit dll as 64 bit, everything else is 64 bit so that step should be trivial.
0
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 39630510
Hi hainansyndrome;

If the dll that can't be modified is a third party dll maybe you can check with them to see if they already have a 32 bit version of that dll.
0

Featured Post

Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question