Copy link to clipboard
Copied
Hello liable Cowboys, PS: Why i am mad because it doesn't work for me! Stop forcing my development. I am mad now. I have tried sometimes time. It doesn't work. I am using Windows 10 Pro x64, Visual C++ 2010 Express Code: dllmain.cpp ( only EasyNativeExtensions ) #include "FlashRuntimeExtensions.h" #include #include extern "C" { FREObject isSupported(FREContext ctx, void* funcData, uint32_t argc, FREObject argv[]) { FREObject result; uint32_t isSupportedSwitch = 1; FRENewObjectFromBool(isSupportedSwitch, &result); return result; } FREObject getString(FREContext ctx, void* funcData, uint32_t argc, FREObject argv[]) { FREObject result; const char *testString = "Hello World from C++!"; FRENewObjectFromUTF8(strlen(testString)+1, (const uint8_t *) testString, &result); return result; } void contextInitializer( void * extData, const uint8_t * ctxType, FREContext ctx, uint32_t * numFunctionsToSet, const FRENamedFunction ** functionsToSet ) { // Create mapping between function names and pointers in an array of FRENamedFunction. // These are the functions that you will call from ActionScript - // effectively the interface of your native library. // Each member of the array contains the following information: // { function name as it will be called from ActionScript, // any data that should be passed to the function, // a pointer to the implementation of the function in the native library } static FRENamedFunction extensionFunctions[] = { {(const uint8_t*) "as_isSupported", NULL, &isSupported}, {(const uint8_t*) "as_getString", NULL, &getString} }; // Tell AIR how many functions there are in the array: *numFunctionsToSet = sizeof( extensionFunctions ) / sizeof( FRENamedFunction ); // Set the output parameter to point to the array we filled in: *functionsToSet = extensionFunctions; } void contextFinalizer(FREContext ctx) { return; } __declspec(dllexport) void MyExtensionInitializer(void** extData, FREContextInitializer* ctxInitializer, FREContextFinalizer* ctxFinalizer) { *ctxInitializer = &contextInitializer; // The name of function that will intialize the extension context *ctxFinalizer = &contextFinalizer; // The name of function that will finalize the extension context } __declspec(dllexport) void MyExtensionFinalizer(void* extData) { return; } } I create swc file package { import flash.events.EventDispatcher; import flash.events.IEventDispatcher; import flash.external.ExtensionContext; public class MyExtension extends EventDispatcher { private var _ctx :ExtensionContext = null; public function MyExtension(target:IEventDispatcher=null) { super(target); _ctx = ExtensionContext.createExtensionContext("MyExtension", null); } public function isSupported():Boolean { return _ctx.call("as_isSupported"); } public function getString():String { return _ctx.call("as_getString") as String; } public function dispose():void { _ctx.dispose(); } } } And XML: MyExtension 1 MyExtension.dll MyExtensionInitializer MyExtensionFinalizer ANd adt command: PAth to\adt.bat -package -target ane MyExtension.ane extdesc.xml -swc MyExtension.swc -platform Windows-x86 -C . library.swf MyExtension.dll And i add ane file to my project And i try it but doesn't work why???
Than it gives error message: TypeError: Error #1009: Cannot access a property or method of a null object reference. at StopLiar/onCreatingComplete()
Copy link to clipboard
Copied
could you please format your post? It is hard to read & understand
Copy link to clipboard
Copied
Sorry my dear - my problem with Air Native Extension. I can not understand because i have searched Google like Visual Express C++ 2010 under Windows 10 Pro x64. I am trying to create dll and i have created project as swc and i unpack library.swf from swc file and adt -package ..... myextension.dll than it was created own ane and it is completed. And i tested Project with ane file and i have edited "supportProfile as externedDesktop" i run air app with ane than it throws always error message like "unknown method or proprety" Why does it happen with Air Native Extension" I have made sure extension.xml with initalizer and finalizer all correct.. Why does it not work? I am trying to 3.1 namespace for ane = No working... latest version of namespace = no working. Why does it happen? I really miss my development since August 2015 with ane and tested Air App and it works fine. Possible 19 version has bug? Can you try it If i create unknown initalizer and unknown finalizer than it doesn't recognize to Air apps. I can not understand that. Please check correct Adobe Air SDK latest version doesn't get critical issues. Thanks! Since 1 1/2 months i am getting angry to Adobe System why does it happen with Air Native Extension? I thought ANE doesn't work under Windows 10 x64 That is why i am sorry for i am confused for that.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now