How to work with 3rd party 32-bit framework in 64-bit Cocoa Application? - objective-c

I have a 64-bit-only application that I am developing in Objective-C on Cocoa. It includes various plugins that are also 64-bit. One of these plugins needs to use a 3rd party Framework that is only built for 32-bit i386. It is a C-based framework. It is not possible for the 3rd party to produce a 64-bit version at this time.
I do not want to change my entire application and plugin suite to be 32-bit just to accommodate this one 32-bit framework, but I also do not have any alternatives since it provides access to a proprietary piece of hardware and is the only means my application (via the plugin) will have to operate the device.
What are my options for making this all work?
Clearly my plugin needs to be 64-bit, otherwise the main application will not load it. However, In that case I cannot link against the 32-bit external Framework. I have read that I may need a 32-bit helper application that the plugins communicates with, but have no idea if that is a good or recommended approach.
Are there any other ways to do this? If not, can someone point me to any documentation or tutorials on making this work?

An option would be to create a standalone 32-bit application that uses the framework and controls the device. Then have a 64-bit plugin to your app that launches the standalone app and communicates with it through some IPC mechanism.

Related

What is the technology used to build u-blox's u-center?

u-blox's u-center is a desktop application for Windows OS that is light-weight and accommodates all the streamed data without problems.
What is the toolkit or framework (.Net "I doubt it", Win32 API, MFC) used to build such a desktop application like u-blox's u-center?
It is based on Win32 API and MFC. MFC is statically linked. See also the second page of the user manual.
https://www.u-blox.com/sites/default/files/u-Center_UserGuide_%28UBX-13005250%29.pdf

Creating Portable class library for Xamarin.mac

We are developing a mac application using Xamarin.mac. Since we want the same application to be developed for windows as well, we decided to write all the business logic inside a Portable class library. Is PCL Supported for Xamarin.mac?.
A much easier approach for sharing code between a Windows and a Mac app (talking from first hand painful expirience) is something called "Shared Project". What it will do is it will "Inject" itself into the build process for a specific platform, and as long as the references you use are accessible on both platforms, all will be well.

Write an windows app for USB Drive

I want to write an application in .Net that has to be shipped with USB drive by the manufacturer. Rightnow application targetted to run only in windows. But will have to support other opeating system in future. Is that app needs to be shipped as portable application? What is required in order to run a .net app as portable app in USB drive? If .Net is not a good option, what are other platform that helps to implement this?
Do deploy .net applications without .net you have to use tools like Xenocode: http://www.xenocode.com
To run it on others platforms, have a look at the Mono Project: http://www.mono-project.com

What changes I need to make to my WCF application to run on 64 bit OS?

I have a C#/WCF application (hosted in windows service) which was deployed and tested on 32 bit Windows server. Now I need to deploy it for production. My network team suggested to deploy it on 64 bit Windows Server to take full advantage of server capabilities.
My questions:
Is there any performance gain in deploying an application on 64 bit OS? If yes, how much?
Do I need to do any special to make my application 64 bit OS compatible? If yes, what?
P.S. My application is compiled with "Any CPU" option (Does it matter?).
There is blogs of information out there on this. A quick Bing will bring up 1000s of talking points: http://www.bing.com/search?q=x64+vs+x86+server&src=IE-SearchBox&FORM=IE8SRC But, to be brief:
Is there any performance gain on deploying an application on 64 bit OS? If yes, how much?
The most noticeable benefit is memory utilization - specifically, your service/app, and all of the server's other services/applications, have more room to play. Only true if you have 4 GB or more of RAM. If you have less than that, you are actually wasting memory by each allocation of block.
The benefit, at the raw-performance level, is for every CPU cycle, you can execute up to 64bits of information, instead of 32bits - double the information. Significantly more noticeable with multi-threaded applications: e.g. Your WCF Service hosted in IIS, which is multi-threaded for the incoming requests. :)
Do I need to do any special to make my application 64 bit OS compatible? If yes, what?
Short answer, nothing what-so-ever. :) And that's the benefit of .NET, when you compile with the default "Any CPU" option!
When you compile code into assemblies, you are compiling code into an Intermediate Language (IL) - not actual machine code. The .NET CLR (Common Language Runtime) version, that is installed on the specific server/workstation/device that you are deploying to, is what takes your IL code and executes it in native instructions for that specific platform - x86, x64, or IA-64 (or AMD64, ARM, etc if there any tweaks utilized). You do not have to do anything!
As for coding practices, there is nothing specific to do either.
Referencing 3rd Party Native Assemblies?
Now, the only concern is if you are using referencing any 3rd-party assemblies through COM or alike that are compiled in native code (i.e. basically, 3rd party assemblies writting in raw languages). That becomes tricky referencing a 32-bit native assembly via a CLR on a x64 machine (basically, you have to force your application to complile to 32bit to access it). There are other work-arounds though, which is outside of the scope of this answer.
That's why I either: stick to all .NET references, reference only 3rd party assemblies written in .NET, just write it myself, or beg the author of the 3rd party component to release both 32bit and 64bit compiled versions. The latter becomes difficult to test on your x86 (32bit) machine as you can only reference the 32bit versions, but will have to deploy the 64bit versions.
More-of-a-headache is when dealing with your own WCF project, and those 3rd-party native assemblies, is that the built-in WCF hosting service in Visual Studio (as well as Cassini) is only 32-bit, as well as Visual Studio's IntelliSense. Yeah, it's fun when using 3rd party native assemblies and trying to debug applications on a x64 machine. Good times!

How to make vb.net apps portable?

Is it possible to make an vb.net application portable?
It is portable - build your .exe and copy it on your flash drive. Assuming it will be run where there is .net framework, there is no problem!
EDIT: A similar topic here: Writing USB Drive Portable Applications in C#
"portable" has more than one meaning, but if you mean a program that could also run on linux or mac than you need to think mono. Specifically, look at their migration analyzer.
Depends on what you mean by "portable". Certainly, you can build them without external dependencies on things like config files, registry settings, etc. You'll still need the .NET runtime installed on the target computer, though.
I seem to recall that you can use vb.net to write Silverlight apps; once compiled, this should be fairly portable (onto all Silverlight / Moonlight enabled browsers).
Of course, if you talk about web apps, the client (html) should already be portable, regardless of the server.
Whether it's a desktop application or a web application, the .Net framework needs to be installed on the machine that the app is run on. Generally, the .Net framework is installed with Windows.
It has to be the same version of the .Net framework as the app was developed in (1.0, 1.1, 2.0, 3.0, 3.5). Which version of the framework is installed depends on the version of Windows.
Just a thought!
Maybe you can make your app executable the normal way (with setup) and then make it into a portable application online using service described at
http://www.abtevrythng.com/2011/12/make-portable-applications-online-for.html#ixzz1flSBi6dZ
You can try to use the online portable app "converter" Cameyo to do it. Just install the Cameyo app, launch it, then install the application you made.
You must use VS 2015. Make all your reference dll's to be local copied. Build your solution (with no deploy file extension (publish-> options->deployment))and merge the exe file with your dll with ilmerge ( http://www.microsoft.com/en-us/download/details.aspx?id=17630 ) (download ILmerge-GUI too) from the Microsoft web site. And have good luck