native-code

How does CreateStdDispatch know what method to invoke?

北城以北 提交于 2019-12-04 10:57:35
i'm faced with implementing an IDispatch interface. There are four methods, and fortunately 3 of them are easy: function TIEEventsSink.GetTypeInfoCount(...): HResult; { Result := E_NOTIMPL; } function TIEEventsSink.GetTypeInfo(...): HResult; { Result := E_NOTIMPL; } function TIEEventsSink.GetIDsOfNames(...): HResult; { Result := E_NOTIMPL; } It's the last method, Invoke that is difficult. Here i am faced with having to actually case the DispID , and call my appropriate method; unmarhsalling parameters from a variant array. function Invoke( dispIdMember: DISPID; riid: REFIID; lcid: LCID; wFlags

Android NDK: How to override onBackPressed in NativeActivity without java?

眉间皱痕 提交于 2019-12-04 08:39:19
问题 My app is written entirely in C/C++ using NativeActivity , it has no Java code (based on "native-activity" NDK example). Pressing "back" button closes it (destroys activity), but I need other behaivor of this button because I have my own UI and menus which are displayed via OpenGL. As I read, In order to change behaivor of "back" button, I need to override onBackPressed() method of Java activity class. But I don't use Java, can I reach this method from C/C++ to override it? If no, is there

How to print log messages with in Android framework

空扰寡人 提交于 2019-12-04 03:47:31
问题 I am trying to print log messages within core Android framework files. For example, I tried logging messages within MediaRecorderClient.cpp under frameworks\base\media\libmediaplayerservice\ . I've tried LOGV , LOGE , LOGD , printf , and __android_log_print , without any success. Which command should I use to print log messages? 回答1: Log should be used, but it will print to logcat not system print. Example: Log.d("filter", example text); // filter is any tag you want to use as filter You can

com4j on Windows 64 bit

谁都会走 提交于 2019-12-03 21:10:19
问题 I've downloaded the latest com4j jars and I'm trying to run through the most simple of their examples. I'm on Windows 7 64 bit and using a 64 bit JVM. When I run the command (from the com4j tutorial): java -jar tlbimp.jar -o wsh -p test.wsh %WINDIR%\system32\wshom.ocx I get: Exception in thread "main" java.lang.UnsatisfiedLinkError: com4j-amd64.dll: %1 is not a valid Win32 application at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(Unknown

Could C++.Net assemblies be decompiled easily?

一世执手 提交于 2019-12-03 16:43:12
I know that all assemblies can be decompiled somehow, but C# & VB applications are the easiest to be decompiled into source code using tools like ( .Net Reflector ). So my question is, if I programmed an application using .Net assemblies and functions with C++, would it be easy to decompile it as if it was a C# or VB application with .Net reflector and such tools? Ok, if I programmed it without using any function from .Net framework and made UI only what calls .Net assemblies, would be easy to decmpile also ? My question is similar to this one : Could this C++ project be decompiled with such

Why native wrapped functions in Dart are such heavyweight in comparison with “DEFINE NATIVE ENTRY” functions that are very lightweight?

☆樱花仙子☆ 提交于 2019-12-03 15:26:12
I cannot understand: "Why this reassurance?". This is wrapper for custom native function from dart/runtime/vm/native_entry.cc : It intended for the Dart programmers that want write native extensions . void NativeEntry::NativeCallWrapper(Dart_NativeArguments args, Dart_NativeFunction func) { CHECK_STACK_ALIGNMENT; VERIFY_ON_TRANSITION; NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); Isolate* isolate = arguments->isolate(); ApiState* state = isolate->api_state(); ASSERT(state != NULL); ApiLocalScope* current_top_scope = state->top_scope(); ApiLocalScope* scope = state-

How is Trello iPhone app developed?

白昼怎懂夜的黑 提交于 2019-12-03 09:36:51
问题 I was wondering which libraries or frameworks Trello iphone app is using. Is it a webapp with JS framework? if yes, which one? Or is it native? which frameworks for this here? I'm curious because I really like the UI, and has searched the internet without luck. 回答1: I'm on the Trello team and wrote the iPhone app. It's all native code except for the attachment viewer, which is just a WebView. We use RestKit to communicate with our API and help cache the data locally to CoreData. Otherwise, it

Access violation in native code with hardware accelerated Android MediaCodec decoder

独自空忆成欢 提交于 2019-12-03 09:03:49
I aim to use the Android MediaCodec for decoding a video stream, then use the output images for further image processing in native code. Platform: ASUS tf700t android 4.1.1. Test stream: H.264 full HD @ 24 frm/s With the Tegra-3 SoC inside, I am counting on hardware support for the video decoding. Functionally, my application behaves as expected: I indeed can access the decoder images and process them properly. However, I experience a very high decoder cpu load. In following experiments, process/thread load is measured by "top -m 32 -t" in adb shell. To get reliable output from "top", all 4

Why is it that bytecode might run faster than native code [closed]

百般思念 提交于 2019-12-03 07:22:56
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 8 years ago . Java is slow. That's more than an "urban legend", it seems to be a fact. You don't use it for live-coding because of latency and you

Android NDK: How to override onBackPressed in NativeActivity without java?

落花浮王杯 提交于 2019-12-03 00:24:30
My app is written entirely in C/C++ using NativeActivity , it has no Java code (based on "native-activity" NDK example). Pressing "back" button closes it (destroys activity), but I need other behaivor of this button because I have my own UI and menus which are displayed via OpenGL. As I read , In order to change behaivor of "back" button, I need to override onBackPressed() method of Java activity class. But I don't use Java, can I reach this method from C/C++ to override it? If no, is there another way to handle with "back" button using NDK, without java code? Solved: to prevent default "Back"