managed

Managed version of Spy++ Tool?

落花浮王杯 提交于 2019-11-30 05:27:12
Awhile ago, I needed a Spy++ like application for some .NET UI debugging. I found an old MSDN article with a sample that does things similarly, But that stopped working in newer .NET Framework versions. Does anyone know of/wrote an application that mimics Spy++ behavior and works on Managed applications (rather, shows Managed events/properties) and works on newer .NET Frameworks, up to 4.0? I can recommend UISpy , a spy utility which uses the UI Automation framework to transparently spy on plain Win32 applications as well as Windows Forms or WPF . It's a bit hard to find UISpy, but I

How do I call C++/CLI (.NET) DLLs from standard, unmanaged non-.NET applications?

落爺英雄遲暮 提交于 2019-11-30 03:29:21
问题 In the unmanaged world, I was able to write a __declspec(dllexport) or, alternatively, use a .DEF file to expose a function to be able to call a DLL. (Because of name mangling in C++ for the __stdcall, I put aliases into the .DEF file so certain applications could re-use certain exported DLL functions.) Now, I am interested in being able to expose a single entry-point function from a .NET assembly, in unmanaged-fashion, but have it enter into .NET-style functions within the DLL. Is this

What's the difference between a non-unmanaged type and a managed type?

自古美人都是妖i 提交于 2019-11-30 03:26:06
When I wrote the following snippet for experimenting purposes, it raised the hover-error (see screenshot): Cannot declare pointer to non-unmanaged type 'dynamic' The snippet: dynamic* pointerToDynamic = &fields; While the code is clearly not allowed (you cannot take the address of a managed type), it raised with me the question: what is a non-unmanaged type and how is it different to a managed type? Or is it just Visual Studio trying to be funny? There is a difference between unmanaged and non-managed pointers. A managed pointer is a handle to an object on the managed heap, and AFAIK is

C++/CLI : Casting from unmanaged enum to managed enum

人盡茶涼 提交于 2019-11-30 01:29:58
What is the correct way of casting (in C++/CLI) from a native code enum to a managed code enum which contain the same enum values? Is there any difference with using the C# way of casting like for example (int) in C++/CLI. mcdave Assuming your native code is enum shape_type_e { stUNHANDLED = 0, //!< Unhandled shape data. stPOINT = 1 //!< Point data. ... }; and your managed code is public enum class ShapeType { Unhandled = 0, Point = 1, ... }; You can cast from the native to the managed using shape_type_e nativeST = stPOINT; ShapeType managedST = static_cast<ShapeType>(nativeST); Debug.Assert

Any CPU not available in C++/C# solution

二次信任 提交于 2019-11-30 00:24:22
I have a solution that contains C# and managed C++ projects. It compiles in the solution platform x64 and x86. Since it is managed C++ I wanted to create a 'Any CPU' solution and get rid of the old ones. I changed the C++ project linker settings to Force Safe IL Image for both x64 and x86. Next, using the Configuration Manager, I created a new solution platform called 'Any CPU'. Next I added a project platform also called 'Any CPU'. I proceeded to set all the C# projects to 'Any CPU', but for the C++ I can't do that. The project platform 'Any CPU' is not in the drop down, and there is also no

Passing char pointer from C# to c++ function

时光怂恿深爱的人放手 提交于 2019-11-29 14:55:41
I am stuck in c# implementation side, as I am pretty new to it. The thing is, I want to pass a 'pointer'(having memory) from c# code so that My c++ application can copy pchListSoftwares buffer to pchInstalledSoftwares. I am not able to figure out how to pass pointer from c# side. native c++ code(MyNativeC++DLL.dll) void GetInstalledSoftwares(char* pchInstalledSoftwares){ char* pchListSoftwares = NULL; ..... ..... pchListSoftwares = (char*) malloc(255); /* code to fill pchListSoftwares buffer*/ memcpy(pchInstalledSoftwares, pchListSoftwares, 255); free(pchListSoftwares ); } Passing simple

What are managed types? Are they specific to Delphi? Are they specific to Windows?

不问归期 提交于 2019-11-29 07:40:50
Summarization: Please check the knowledgeable comments below. ============================================================== I have seen the term of managed types mentioned in quite a few stackoverflow Delphi topics. For example, it is mentioned in topics of correctly initializing/finalizing . However, when I google managed types , it seems most links are related to C++, or .NET. For example, see the MSDN page . Could some one help to comment what are managed types defined in Delphi? Given that Delphi for POSIX/MacOS is being born, are managed types specific to Windows? Thanks for your effort

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

C++/CLI : Casting from unmanaged enum to managed enum

二次信任 提交于 2019-11-28 22:19:48
问题 What is the correct way of casting (in C++/CLI) from a native code enum to a managed code enum which contain the same enum values? Is there any difference with using the C# way of casting like for example (int) in C++/CLI. 回答1: Assuming your native code is enum shape_type_e { stUNHANDLED = 0, //!< Unhandled shape data. stPOINT = 1 //!< Point data. ... }; and your managed code is public enum class ShapeType { Unhandled = 0, Point = 1, ... }; You can cast from the native to the managed using

Any CPU not available in C++/C# solution

家住魔仙堡 提交于 2019-11-28 21:22:23
问题 I have a solution that contains C# and managed C++ projects. It compiles in the solution platform x64 and x86. Since it is managed C++ I wanted to create a 'Any CPU' solution and get rid of the old ones. I changed the C++ project linker settings to Force Safe IL Image for both x64 and x86. Next, using the Configuration Manager, I created a new solution platform called 'Any CPU'. Next I added a project platform also called 'Any CPU'. I proceeded to set all the C# projects to 'Any CPU', but for