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()[C:\Users\JensLaptop\Adobe Flash Builder 4.6\StopLiar\src\StopLiar.mxml:12] at StopLiar/___StopLiar_WindowedApplication1_creationComplete()[C:\Users\JensLaptop\Adobe Flash Builder 4.6\StopLiar\src\StopLiar.mxml:3] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent()[/Users/erik/Documents/ApacheFlex/git/flex-sdk4.14.1/ frameworks/projects/framework/src/mx/core/UIComponent.as:13688] at mx.core::UIComponent/set initialized()[/Users/erik/Documents/ApacheFlex/git/flex-sdk4.14.1/frameworks/projects/fra mework/src/mx/core/UIComponent.as:1839] at mx.managers::LayoutManager/doPhasedInstantiation()[/Users/erik/Documents/ApacheFlex/git/f lex-sdk4.14.1/frameworks/projects/framework/src/mx/managers/LayoutManager.as:850] at mx.managers::LayoutManager/doPhasedInstantiationCallback()[/Users/erik/Documents/ApacheFl ex/git/flex-sdk4.14.1/frameworks/projects/framework/src/mx/managers/LayoutManager.as:1188] Why why why ???????????????????????????????? I have checked ane file my ane file is here library.swf and Meta-MF and more more all here. Why does it not work? Stop lie or force my development! because i have tried same code formation like numFunction[x] or static externedfunction or method accessFunctions not work Or Visual Studio 2010 doesn't compatibile to Windows 10. But I have tested Visual C++ 2010 Express under Windows 10 Pro x64 Working fine! 100 % How do i fix it? Please tell me! Thanks i am sorry for argue to you because i know same cowboys lie more than German I know that. :P