AS3 to C++ conversion – possible? - c++

I built an iPad app in actionscript. A potential partner wants to pull my app into their app. They built their app natively using XCode. From what I understand, if my app had been built natively, I could simply export the code as a static library (.a file) for use by their app. Alas, I built mine in actionscript. So...
Is there a way to convert ActionScript 3 to C++?
Is one possible solution to do this conversion via AS3 to Haxe to C++?
Am I simply SOL and need to rebuild the game using XCode?
Thanks in advance.
Jason

You might consider the Tamarin project or Tamarin redux.
http://www-archive.mozilla.org/projects/tamarin/
It can be compiled in XCode as well. However, if your application is heavily depended on Flash runtime you have to implement all classes by yourself, because AVM contains only the basic AS3 classes.

Related

Integrating a c++ library (.dll and .lib files) into a CFX based Firefox Plugin so that all code interacts on the browser or client computer.

Introduction:
I am building a plugin for Firefox version 31.5.0 using the cfx tool. I have been provided with a C++ SDK with header files, .dll files and a .lib file. For this application, I cannot run any scripts or programs on the server, so all code has to work on the client side. Is it possible to integrate this library into my Firefox Plugin (coded mostly in Javascript) such that everything runs on the client side?
Conditions:
I know this isn't the best way to go about developing a web plugin, but it is a requirement I'm faced with. I cannot run anything server side.
Emscripten is a tool I've heard about to convert C++ code to Javascript. For those who have used this tool, are there any deficits in functionality of the code (or even bugs) that arise when converting large libraries to Javascript?
I do not have access to the original source code of the library and thus cannot rewrite it myself in Javascript.
Further Details:
The C++ Library will be used to perform encryption and decryption as well as contact a server for information. Note: The library itself must be executed on the client side.
If C++ isn't viable, I have the option of using JNI to call C++ from a java wrapper application. Is there a way to execute Java code from the client side via the browser?
I apologize for lack of source code. I'm still at the planning stage of this project and I've been tearing my hair out trying to find a solution that fits the criteria.

use c++ lib in flash builder as3 project

Is it possible to use c++ lib inside as3 project? (flash builder 4.7)
I have a project writen in c++ and I want to build the gui with flash.
I'm seracing for a way to use flash and work with my c++ lib
I guess that a Flash GUI is actually some Web interface. Then, you need some HTTP server library in C++, like the Onion library, the network part of Poco libraries, or the Wt library.
BTW, perhaps making a pure HTML5 + Javascript interface is easier and more portable, with the real work done in C++.
Probably not what you are looking for, but you could use FlasCC http://www.adobe.com/devnet-docs/flascc/docs/Reference.html That imposes some requirements on your lib, but I think nothing that #define-s cannot handle )

Sharing code between a dot42 project and a mono desktop project

The idea is to share code between a desktop app using Mono and a dot42 app. So my question is: Is there any way to import a Portable Class Library or even a common library in a dot42 ? If not, is there any way to share code at all between them ?
Thanks.
A dot42 project is either a Visual Studio or SharpDevelop project. There is nothing preventing you to add a class library project to your solution consisting of the same C# source code that is used in your Mono project.
The .NET types are implemented on top of the Android API. For example, the .NET Dictionary class is implemented as a wrapper of java.util.Map and System.String as a wrapper of java.lang.String. In other words, we take the API from .NET but the implementation from Java. This is in contrast to Mono.
When you refer to .NET types and compile your dot42 project to an APK, the .NET types compile to a minimum amount of wrapper DEX code that invokes the Android framework. It therefore does not require an extra runtime and makes the APKs really small.
Here is the API reference of all .NET types that are currently supported (work in progress):
http://docs.dot42.com/Reference/NS.System
We are working on adding support for Portable Class Libraries.
Disclosure: I work at dot42

mix monotouch and Obj-C or C++

I got another crazy idea: why do I want to create a static lib in XCode, then create monotouch bindings for it then linking this lib with monotouch project. That would be much easier to have all the sources in a single project...
I'm trying to have Obj-C, or C or even C++ sources right in monotouch project compiled all-together. But apparently I got no luck with that. I can't make C code to compile from monodevelop.
Does anybody tried this approach? what are pros and cons (if it is possible)?
You're right that you can have several projects, in different languages, inside a single MonoDevelop solution.
However you'll still need to create bindings to access non .NET code (e.g. C/C++) and data from the main (C#) project solution.
So having a single solution can be a bit simpler in many cases but it won't be a lot simpler - unless you're using .NET for every projects.
Note: there are now binding solutions templates in MonoDevelop that can make binding non-.NET code simpler. That's more likely yo help you.

What API/SDK to use for this Windows Application?

I'm going to create a utility with GUI that will run on Windows operating systems.
It should require minimum (or zero!) amount of additional libraries, files or DLLs to run because it will be executed from an installer. Because of this, i don't want to use .NET for it will require user to install .NET Framework. I know today, most of Windows installed system come with .NET Framework but in my case i cannot be sure.
The utility will...
send some data to a web site and
parse the returning data,
collect some hardware info, like MAC address,
CPU type and make, hard-disk serial
number
I suppose native Win32 API could be used for all of those above, but instead of hassling with Win32, i'd prefer using a more developer friendly API, or SDK.
Thanks in advance.
Win32 API is the only way, and of course there are standard API - for sending data over the internet, you could use WinInet.lib/dll, to obtain information about the MAC, you could use the GetAdaptersInfo by using Iphlpapi.lib/dll,(here's a link on how to use it) for the Hard disk serial number you could use GetVolumeInformation by using kernel32.lib/dll. For the CPU Id, you might look into GetSystemInfomation
Edit: There's a C++ code, but you can easily derive a wrapper from this site Unfortunately, with WinAPI is not easy, no such thing as RAD with WinAPI but what you gain out of it is lightweight code instead of relying on SDK's, frameworks and dragging buggy dll's around with your application.
Hope this helps,
Best regards,
Tom.
You can statically link most C++ GUI libraries - even MFC. Personally, I recommend WTL, wihich is very light and header-only.
If what you want is minimum dependency with external files or DLLs you could statically compile all the required DLLs with the tool exe. Then you could use something like Visual C++ to develop such tool.
WTL is perfect for this sort of application and I am surprised more people aren't recommending it. You can also statically link with the CRT and hey presto - no dependencies and a very small EXE.
Delphi (now by Embarcadero) would do the job, creating a .exe file with no dependencies, and it is much easier to work with than the raw Win32 API.
If you don't like Object Pascal, you could try C++ Builder instead.
For the GUI you can either build your application with MFC (statically linked) or use a HTML based dialog that you can interact with using COM. (It is even possible to interact with javascript present in the page displayed by the dialog).
For the specific requirement that you do have, I feel Win32 API is the only way out.
Use MFC and statically link to it. No runtime dependancies need to be installed.