wrapper

passing a HANDLE variable to an unmanaged .dll in C++/CLI

烈酒焚心 提交于 2019-12-08 04:57:26
问题 I am trying to wrap an unmanaged c++ dll that talks to a video capture card in c++/CLI so i can reference the functions from a c# project that i have. I am having trouble getting the 1st wrapped call to work as I am new to c++/cli syntax. here is what i have. here is the function declataion i am trying to wrap. __declspec(dllimport) BOOL AZ_DeviceCreate(HANDLE& hLiveEvent, DWORD* hEncoderEvent, DWORD* pdwEncoderAddress, HANDLE& hAudioEvent, DWORD& dwAudioAddress); here is my c++/cli .h file

why primitive type will call first rather than wrapper classes?

两盒软妹~` 提交于 2019-12-08 04:44:42
问题 public class A { public void test(Integer i) { System.out.println("In Wrapper Method"); } public void test(int i) { System.out.println("In primitive Method"); } public static void main(String args[]) { A a = new A(); a.test(5); } } When I will call test method from main and pass integer argument, then it will call the method which accept primitive type as argument. I just want to know that why it call primitive type method rather than the method who accepts wrapper class as argument? Is there

Cython cdef Class not displaying doc string or __init__ parameters

微笑、不失礼 提交于 2019-12-08 04:30:23
问题 I have used cdef to define a python class which wraps a C++ class with Cython and it works correctly. However when I use help(class) in python or class? in ipython I get something like the following: >>> TestClass.CTestClass? Init signature: TestClass.CTestClass() Docstring: <no docstring> File: ~/Coding/CythonWithCppTutorials/ClassCythonCPPWithMemberFunctions/TestClass.so Type: type Which does not display any doc-string or init signature, which I would like to have displayed, how could I get

Are Kotlin's Float, Int etc optimised to built-in types in the JVM? [duplicate]

江枫思渺然 提交于 2019-12-08 02:42:54
问题 This question already has answers here : Are Kotlin data types built off primitive or non-primitive Java data types? (2 answers) Closed 2 years ago . I'm new to Kotlin, and AFAICT its syntax only supports the object versions of Int, Float etc without the corresponding int and float primitives of Java. But does the compiler or JVM optimise to use the primitive types if possible? I'm concerned that if I use local variables in a function called from a game main loop it might cause GC stutter if

Checking Null Wrappers against primitive values

耗尽温柔 提交于 2019-12-08 02:12:00
问题 Integer i = null; if (i == 3) Why the second line above throws a NullPointerException , IMHO, this has only one meaning which is Wrapper Object i is to be unboxed which yields the Exception such as: ArrayList<Integer> list = new ArrayList<Integer>(); list.add(null); int x = list.get(0); EDIT: Can you supply me with some format doc? 回答1: It throws NPE because compiler does the following "magic" for you: Integer i = null; if (i.intValue() == 3) Obviously i.intValue() throws NPE when i is null .

Custom Web Browser control with support of new CSS3 features

百般思念 提交于 2019-12-08 01:49:07
问题 I'm looking a custom web browser control for .net framework. There is bunch of them here, but they are old and can't run new CSS3 features smoothly (or they simply can't!). For example, Awesomium and Webkit.NET are available but they can't run animations/transitions hardware-accelerated. But, new web browsers (Chrome 21, Firefox 15) are supporting these new features smooth and hardware-accelerated. Is there any .Net Web Brower control with support of new HTML5/CSS3 features? 回答1: If you

Wrapper for DOTNET to native written in C++ CLI BestWay to pass structures?

本小妞迷上赌 提交于 2019-12-07 19:41:23
问题 Yet I am writing a wrapper in C++ CLI for our application to give some new parts (written in C#) save and easy access to old native libraries. Therefore I need to pass some structures from C# to C++. These structures are defined in C++ Cli (dotnet) and also in C++. Example: \\C+++ typedef struct { INFO16 jahr ; INFO8 monat ; INFO8 tag ; INFO8 stunde ; INFO8 minute ; } SDATUM; \\c++ cli [StructLayout(LayoutKind::Explicit)] public value struct SDATUM { public: [FieldOffset(0)] UInt16 jahr;

Difference between “&” and std::reference_wrapper?

二次信任 提交于 2019-12-07 18:50:35
问题 I have following code #include <iostream> #include <vector> #include <functional> int main() { std::vector<double> v(5, 10.3); std::vector<double>& r = v; //std::vector<std::reference_wrapper<double>> r(v.begin(),v.end()); for (auto& i : v) i *= 3; for (auto i : r) std::cout << i << " "; std::cout << std::endl; } I am using reference of the vector 'r' using '&' operator and in the second line which I commented out I am using std::reference_wrapper of C++. Both do pretty much the same job? But

Making a Text-To-Speech Wrapper in Android

拟墨画扇 提交于 2019-12-07 17:57:31
I am attempting to create a wrapper class for Google Android's Text-To-Speech functionality. However, I'm having trouble finding a way to have the system pause until after the onInit function has finished. Attached at the bottom is something of a solution I created based on what I found here: Android speech - how can you read text in Android? However, this solution does not seem to work. Any thoughts on why this might not be working, or what would be a good idea in order to make sure that any Speak() calls happen after my onInit() call? public class SpeechSynth implements OnInitListener {

wrapping template function and <unresolved overloaded function type

纵饮孤独 提交于 2019-12-07 16:40:52
问题 I have problem with my wrapping function. template <typename Iter, typename SomeFunction> void wrap(Iter first, Iter last, SomeFunction someFunction) { someFunction(first, last); } I would like to use it like this: template <typename Iter> void fill5(Iter first, Iter last) { fill(first, last, 5); } int main() { vector<int> v(100, -1); wrap(v.begin(), v.end(), fill5); } But I get test.cpp: In function ‘int main()’: test.cpp:16:40: error: no matching function for call to ‘wrap(std::vector<int>: