Problem with Air Native Extension - my dll file is successful built but ane file can not load...
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()
