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 )
Related
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.
I'm trying to keep my C++ project cross-platform as much as possible.Albeit I do have dependencies on the following MFC\ATL classes: CString, CTime, CTimeSpan.
Is there an open implementation somewhere of MFC\ATL classes?
How common are these packages and should I use the open source libraries to start with, or should I wait until the need arises?
Instead of CString use std::string
Instead of CTime use boost::ptime
Instead of CTimeSpan use boost::time_duration
While this proposal won't answer your cross platform requirement, it does meet the request for an "open implementation of MFC/ATL classes".
Check out the Windows Template Library(WTL).
Microsoft open sourced it some years ago, you can download it from its sourceforge project page, and it's also available from Microsoft's website somewhere.
The description from the SourceForge page:
Windows Template Library (WTL) is a C++ library for developing Windows applications and UI components. It extends ATL (Active Template Library) and provides a set of classes for controls, dialogs, frame windows, GDI objects, and more.
Hope this helps!
I recommend not to rely in those classes. They are specific of MFC/ATL, and won't be easily ported to Unixes, for example. Try to build a separate conversion layer, and try to build around boost libraries, much more portable.
I know this is a very stupid question and I'm very new to C++.
I'm developing Starcraft AI, it is DLL file. I'm trying to use XML to gather some data to the bot, however whenever I build the DLL with /clr option. The bot doesn't load properly. So, my question is what is CLR and is there a way to read/write XML without using /clr build option.
Thanks so much.
The /clr compiler option enables the
use of Managed Extensions for C++ and
creates an output file that will
require the .NET Framework common
language runtime at run time.
(from MSDN)
Starcraft is probably not developed under CLR (.NET Framework runtime).
I've used the free tinyxml library from C++ code - it was quick to get running and reasonably efficient. Well, about as efficient as it's possible for XML to be, anyway.
Starcraft probably won't run .NET binaries. You would have to either write your own XML parser, which probably isn't for you seeing as you are new to C++, or find a C++ library that can do it for you.
Example of one:
http://sourceforge.net/projects/tinyxml/
I'm looking for one just to get a general idea of how a standard C++ project should be properly setup.
(If that's possible... :-p)
Here are my requirements for this project:
module-based (has libraries/modules that compile into a main program module)
compiles cross-platform
I'd like to do this so that I can get a hold on the basics of how a good C++ project is setup, and so that I can test out Premake.
http://code.google.com/p/csvfix/ - cross platform, simple make file, code includes library and executable in a single zip.
FW4SPL is a component-oriented architecture with the notion of role-based programming. FW4SPL consists of a set of cross-platform C++ libraries. Not yet simple, but with a properly setup.
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.