Calling 32 binary from 64 bit application - com

I am working on an application which is in 32 bit. This app is working fine in 32 bit machine .
But when I install it in 64 bit machine it does not work properly. So we planned to compile it in 64 bit configuration. We could compile it and tried to run, It works properly.
But problem is; we have a 3ed party library which is in 32 bit. If I try to call that library from 64 bit, will it create problem, will it work?
I am running it in windows 7 64 bit amchine.
Please guide me to supporting my application to 64 bit.

The JET database engine will never be ported to 64-bit. You will have to consider a different engine. SQL Server Compact or Express are excellent choices.

Related

32-bit to 64-bit conversion dll files

I am working currently in Labview(64-bit) and want to connect a device that has a dll attached. This dll file is written in 32-bit, and now I encounter a problem with since 64-bit can't run the 32-bit.
So is there an option so I can execute the fil or any conversion of the 32-bit to 64-bit?
If you can't recompile the DLL to 64 bit or the vendor doesn't supply a 64 bit DLL there is no (easy) way.
The obvious easiest way for you would be to use Labview 32-bit.
If you know all of the entry points into the 32 bit DLL, you could create a sort of "in-process" server that is a stand-alone 32 bit app which loads the 32 bit DLL. Then you crate a 64 bit DLL that gets loaded into LabVIEW 64 which uses a method of inter-process communications to shuttle the data back and forth between the 32 bit and 64 bit processes. This is a clunky solution, but should work if all else fails.
Read the following article to learn how to create a .lib file for linking to the 32 bit DLL:
http://adrianhenke.wordpress.com/2008/12/05/create-lib-file-from-dll/

vb.net 32 bit vs 64 bit controls become disabled

I am working on a vb.net winforms application that compiles against the 2.0 framework. My issue is that I am running Windows 7 32 bit machine and my app works fine but when the code is copied over to a Windows 7 64 bit machine some of the controls on the form are strangely disabled. In Project Properties it is set to compile as x86 target. Has anyone experienced a similar problem and does anyone have an answer as to why I am having problems on the 64 bit machine?
Set it to compile to Any CPU instead of x86. The framework will deal with the rest for you, you should only target a platform if you have references/controls that require it or if you're playing around with application performance.

The 64 bit dll of Microsoft SharePoint is running on 32 bit machine

I am working on SharePoint domain. Sometime I need to do development for event receiver and windows service etc.
Last week I have installed a Windows Service on my server to upload the documents from a local folder. Server is 64bit machine and "Windows server 2008 R2" installed on server as OS to run SharePoint Foundation 2010. Service was running properly.
The requirement was, no user will go to the server to upload the document. So I have installed the service on local users machine. Some users were having 32 bit Machine and 32 bit OS and other users are working with 64 bit. while installing the service I got an error on 32 bit machines. Error was "This solution is for 64bit machine". After changing the target platform from 64bit to x86, the service was installed successfully on 32 bit machine and started working properly.
Now the question came:
To work with SharePoint Object Model, I am using SharePoint 64 bit
dll in my Windows service which is installed on 32 bit machine and 32
bit OS.
Is it possible that the 64bit dll will work on 32 bit machine?
In what scenarios we can face the problem of "64 bit dll will not
work on 32 bit machine"?
What should I do if I want to install the same solution on 64 bit
and 32 bit machine? I don't want to change the target platform
each and every time.
UPDATE:
After R&D I found "32 bit solution can be installed on 64 bit dll with some terms and conditions" refer http://www.samlogic.net/articles/32-64-bit-windows-folder-x86-syswow64.htm.
In 64 bit machine we are having Program x86 and SysWOW64 folders to handle the 32 bit dll functionality.
Now the question is:
How we are handling the 64 bit dll on 32 bit machines?
And
Is it confirm that the SharePoint dlls are "any CPU"?
Regards.
Not sure I understand what you are trying to do, so I'll try to be exhaustive:
SharePoint Object Model are only available on SharePoint servers, not user workstation. They indeed rely on 64 bits DLL that only work on 64bits OS.
SharePoint 2010 allows you to use the "Client Object Model" that work on remote computer like use workstation. They are .Net DLL, not specific to 32bits or 64bits. Just compile your exe with "Any CPU" and it will work just fine
Generically speaking, 64bits exe only work on 64bits OS. In .Net you can however use "Any CPU" that will work for both 32bits and 64bits. This however will only work if you exe and its dependencies are full .Net (no native code).

Using a 32 bit dll on a 64 bit machine

I have an old project which uses a 32 bit dll. This works fine on 32 bit processor, however when I install the same project on a 64 bit OS it does not work.
Is there any way to convert 32 bit dll to 64 bit? Is there an alternative solution solution to make my 32 bit dll work in a 64 bit OS?
Your 32 bit dll should work just fine on a 64 bit machine as long as it is loaded into a 32 bit process - attempting to load a 32 bit dll into a 64 bit process will fail.
If your project is a .Net (e.g. C#) application then you should be able to target your assembly at x86 in order to get your 32 bit dll working correclty:
Right click on your project in Visual Studio and select Properties
On the Build project properties tab ensure that the Platform target drop down reads "x86" instead of "Any CPU"
If you platform target is "Any CPU" then your project will normally be targeted at whatever platform is available, i.e. x64 on a 64 bit OS - this will prevent your 32 bit dll from being loaded.
If your project is not a .Net assembly then the equivalent steps needed to do the above will be different.
Alternatively you can attempt to obtain a 64 bit version of your dll - if it is a dll that you have produced then you will need to migrate it to 64 bit yourself. If not then you are dependent on the original suppliers providing a 64 bit compatible version.

Can a 64 bit dll be loaded on a 32 bit JVM?

I have a 64 bit dll that has got dependancy with 64 bit oracle and built on a 64 bit machine with 64 bit JVM.
Can this dll be used in a 64 bit system having 32 bit oracle ? JVM is 64 bit.
Also can we load a 64 bit dll using 32 bit JVM?
You cannot load a 64-bit DLL into a 32-bit process. Nor does it work the other way around. See this article for details.