Managed to Native Interop on Windows Azure NO P/Invoke - interop

Does Azure allow managed to native interop without the use of P/Invoke. I have a c header file and dll which I plan to wrap in a managed c++ dll, and then wrap that in a c# wrapper for ease of use.
Anyways, the header file is to complicated to use with P/Invoke, and its much easier to use the managed c++ wrapper, however I don't know if this is possible to do in Azure or any other cloud platform such as EC2 ?
Any ideas ?

Azure does allow native calls, check on this link
But it has to be 64 bit only.

Related

Xamarin Cross Platform Development .net

We are developing a cross platform mobile application using Xamarin. I have noticed there are different ways of structuring your code using Shared code or PCL/.net standard.
I attempted to use .net standard and what i have found is that it doesn't include all the libraries such as using ado stuff , datatable/datasets using system.data. Or using system.net for example. Other functions have less overloads and seems that its a stripped version of .net to work across platforms. Is there any way to add this functionality or use a broader range of .net?
You are correct - .Net Standard and .Net Core are stripped down versions of the full .Net framework. They contain only features that can be used on all platforms (Mac, Android, iOS, Linux, Windows, etc.)
The full .Net framework only needs to work on Windows, so there are additional things that you can do based on the fact that there is less complexity in implementing and that the code base is more mature (cross platform is still pretty new by C# standards). To the best of my memory, System.Net should work if you have your references correct, but System.Data will not (or at least direct database access is not possible)
You can regain some functionality through NuGet packages, but it won't be the same as using WinForms or something like that...
My best advice would be to program against an API. You can use a web server that runs on the normal (full) .Net framework, and does all the heavy lifting using all the .Net features that you are accustomed to. Your Xamarin app would send and receive data from the API and basically provide a mobile front end for whatever you are doing. This approach makes sense for most apps anyway, and is generally what you would be doing anyway if you used Swift and Java to create separate iOS and Android apps.

Azure running native win32 code?

From this post i see we can run un-managed code in azure.
Running Native Code
My question is do we have access to all Win32 API's in azure, or are there any limitations. In general are there any limitations (which some of you may have come across) in running un-managed code in azure.
Thanks
Nakago...
Most Win32 APIs will work fine. But please note Windows Azure is a service environment, so in general it doesn’t make sense to call APIs like CreateWindowsEx.
In addition, by default, only core OS components are installed. Please install libraries like ATL yourself, if you wish to use them (via startup task or custom VM image). Please also manually enable Desktop Experience to use certain OS features. From my experience, I’ve tried to use Direct2D (to process images, but not render them) and Media Foundation, it doesn't encounter any issues.
Best Regards,
Ming Xu.

System.windows.forms.tlb

in the windows SDK there is this file residing in the Lib-directory. Is it possible to use this file with VB6? Google found nothing about it.
If not, in which language (Excep c++) can I use it?
resp. for what is it good for (yes, I know .net winforms)
Thanks regards
Oops
That file provides the COM interface information for the .NET objects that are exposed via COM interop. You can't use it directly, as it only provides the interface information.

WindowsImagingComponent or System.Windows.Media.Imaging

I need to work with some bitmaps in managed code and save them as PNG files. Should I use Microsoft.WindowsAPICodePack.DirectX.WindowsImagingComponent, or System.Windows.Media.Imaging? They both seem very similar, and I'm not sure why I would choose one over the other. Can anybody compare and contrast them?
They both use WIC, that's why they are so similar. The Windows API Code pack is retired content, you'll want to use the WPF namespace since it is available on .NET 3 and up and doesn't require a separate install.
Microsoft.WindowsAPICodePack.DirectX.WindowsImagingComponent is in the Windows API Code Pack, which is a source code library that you would need to build into your application. On the other hand, System.Windows.Media.Imaging is included in the .NET Framework.
If you have no other use for the Windows API Code Pack, I would recommend using System.Windows.Media.Imaging. I believe the inclusion of a WIC API in the Windows API Code Pack is primarily for interoperability with the DirectX APIs in the Code Pack, which have no equivalents in the .NET Framework.

Can you call COM components from server side javascript?

Is it possible (using one of the server side implementations of javascript .. see http://www.nakedjavascript.com/getting-started-55) to instantiate a COM object and invoke methods on it?
There is node-win32ole (npm install win32ole).
That depends on which server-side implementation you’re using.
When using ASP/JS (or any other framework using Microsoft’s Windows Scripting engine), that’s not a problem using the ActiveXObject constructor.
When using JSDB, you can use the ActiveX constructor.
Node.js doesn’t really work on Windows, only thru Cygwin, so ActiveX probably won’t be supported.
I have no idea how easy or difficult it would be to access COM objects from SpiderMonkey, V8 or SquirrelFish directly. They have C/C++ interfaces — and are open source, so if you know your way in the language, you could probably add it.

Resources