mixed-mode

How can I send a managed object to native function to use it?

早过忘川 提交于 2019-11-29 04:52:00
How can I send a managed object to native function to use it? void managed_function() { Object^ obj = gcnew Object(); void* ptr = obj ??? // How to convert Managed object to void*? unmanaged_function(ptr); } // The parameter type should be void* and I can not change the type. // This function is native but it uses managed object. Because type of ptr could not be // Object^ I called it "Unmanaged Function". void unmanaged_function(void* ptr) { Object^ obj = ptr ??? // How to convert void* to Managed object? obj->SomeManagedMethods(); } The cleaner and the better approach is to use gcroot

Mixed Mode Library and CRT Dependencies - HELP

孤街浪徒 提交于 2019-11-28 11:26:41
问题 Alright, after doing a ton of research and trying almost every managed CPP Redist I can find as well as trying to copy my DLLs locally to the executing directory of the app I cannot figure out what dependencies i'm missing for this mixed mode library. Basically I have a large C# application and I'm trying to use a mixed mode library I made. On the development machine it works perfect (of course) but deployed when the library needs to be loaded for use it exceptions out because of missing CRT

Standard conformant way of converting std::time_t to System::DateTime?

血红的双手。 提交于 2019-11-28 10:30:36
I have already found several answers related to converting a std::time_t value to System::DateTime and back. However, almost all answers seem to neglect that the type of std::time_t is actually undefined in the standard. Most solutions just cast std::time_t to whatever needed or apply arithmetic operations to a std::time_t object which is possible since it's an arithmetic type, but there is no specification about the result of such an operation. I know that most compilers define time_t as an int of some size but the fact alone that it has changed from int32 to int64 in many implementations

unmanaged var as member of managed class c++

让人想犯罪 __ 提交于 2019-11-28 08:09:36
问题 I'm novice in .net c++ and trying to create class looking like: public ref class Klient { public: Klient(){} // zmienne static DWORD klienty[41][2]; static int i = 1; static DWORD* pid; static HANDLE* handle; //funkcje }; but MSV says that: error C4368: cannot define 'klienty' as a member of managed 'Klient': mixed types are not supported What's wrong with this code? 回答1: You can have .NET basic data types as members of your managed class (static int i), or pointers to anything unmanaged

New SQLite mixed assemblies

﹥>﹥吖頭↗ 提交于 2019-11-28 05:50:41
Previously .NET SQLite libraries were available from http://sqlite.phxsoftware.com , but they have recently been taken over by the main SQLite team and have moved System.Data.SQLite Download Page . The new packages don't seem to contain mixed assemblies anymore (single assembly containing sqlite3.dll and the .NET wrapper). The new package comes with the .NET DLL and SQLite.Interop.dll which based on the documentation is not needed on the desktop but my application fails to load with Unable to load DLL 'SQLite.Interop.DLL': The specified module could not be found. . I have tried running the

Resolve managed and native stack trace - which API to use?

霸气de小男生 提交于 2019-11-28 04:32:32
问题 This is continuation to my previous question - phase 2 so to say. First question was here: Fast capture stack trace on windows / 64-bit / mixed mode Now I have resolved a huge amount of stack traces and now wondering how to resolve symbol information of managed stack frames. For native C++ side it's relatively simple - First you specify which process from where to take symbols: HANDLE g_hProcess = GetCurrentProcess(); Where you can replace process in run-time using code snipet like this: g

c++/cli DLL fails under Win 8.1

痞子三分冷 提交于 2019-11-27 23:12:22
问题 i have written a Win32/net DLL, it works fine under Win XP, Win7 and 8 but under Win 8.1 it fails. Dependency Walker says: API-MS-WIN-CORE-KERNEL32-PRIVATE-L1-1-1.DLL not found (user32.dll will call them) Google means, MS changed some System-DLLs in 8.1 (and ignored compatibility), so that many programs have the same problem. Full list with "file not found": API-MS-WIN-CORE-KERNEL32-PRIVATE-L1-1-1.DLL API-MS-WIN-CORE-PRIVATEPROFILE-L1-1-1.DLL MSVCR120.DLL API-MS-WIN-CORE-SHUTDOWN-L1-1-1.DLL

mixed mode authentication against AD and fallback to the database if it fail with Membership providers

流过昼夜 提交于 2019-11-27 19:27:19
问题 my user will use form authentication against Active Directory or database. Theres no Windows Integrated Authentication there!! What i want is when the user submit the authentication form, it will try to validate the user against Active Directory and if it fail, try with the database. How can i do that? What i had in mind was to build a custom membership provider that will encapsulate the logic but im not sure how to start. is there any better idea? 回答1: The only way you are going to be able

New SQLite mixed assemblies

不打扰是莪最后的温柔 提交于 2019-11-27 01:05:28
问题 Previously .NET SQLite libraries were available from http://sqlite.phxsoftware.com , but they have recently been taken over by the main SQLite team and have moved System.Data.SQLite Download Page . The new packages don't seem to contain mixed assemblies anymore (single assembly containing sqlite3.dll and the .NET wrapper). The new package comes with the .NET DLL and SQLite.Interop.dll which based on the documentation is not needed on the desktop but my application fails to load with Unable to

ASP.NET MVC and mixed mode authentication

依然范特西╮ 提交于 2019-11-27 00:53:22
I have a scenario whereby I require users to be able to authenticate against an ASP.NET MVC web application using either Windows authentication or Forms authentication. If the user is on the internal network they will use Windows authentication and if they are connecting externally they will use Forms authentication. I’ve seen quite a few people asking the question how do I configure an ASP.NET MVC web application for this, but I haven’t found a complete explanation. Please can someone provide a detailed explanation, with code examples, on how this would be done? Thanks. Alan T This is called