Questions tagged [managed]

Managed refers to code that requires and will only execute under the control of a Common Language Runtime (CLR). Any code written in C# or Visual Basic .NET is managed code.

890 questions
4
votes
1 answer

Reverse P/Invoke (also) Managed Callback to Unmanaged Code

The included C# unit test and C code file attempts to pass a managed callback to unmanaged code. The code actually runs but the count variable never increments. So the test fails. The fact that it runs at all means that it does load the dll, finds…
Wayne
  • 2,959
  • 3
  • 30
  • 48
4
votes
2 answers

C# DLLImport for C++ dll

I have a .dll built in C++/CLI and .NET. Therefore, it is targeted to .NET applications. The API is a set of wrappers that uses managed types so it is NET native. I have imported the .dll and added a function like: [DllImport(@"maplib.dll")] public…
dnclem
  • 2,818
  • 15
  • 46
  • 64
4
votes
1 answer

How to tell if its a managed memory leak or native memory leak?

My .NET process that interops with native dlls is throwing an OutOfMemory Exception. Following is out put of !address -summary and --eeheap-gc coammands. Does this mean if its a managed leak or native leak? 0:000> !address -summary …
Silverlight Student
  • 3,968
  • 10
  • 37
  • 53
4
votes
6 answers

Static libraries with managed code issue

Problem (simplified to make things clearer): 1. there is one statically-linked static.lib that has a function that increments: extern int CallCount = 0; int TheFunction() { void *p = &CallCount; printf("Function…
Lenik
  • 1,518
  • 1
  • 16
  • 24
4
votes
2 answers

Loader lock error with managed c++ dll, statically linked to a native c++ lib

I have a managed c++ dll with few managed classes that in turn call native c++ code in a library that I have statically linked to the dll. However, if I try to run RegAsm.exe on the dll, the tool correctly reports 'no types we registered' but then…
Martin Gunia
  • 1,091
  • 8
  • 12
4
votes
2 answers

Establish a mapping between a managed object and a native pointer in c++/cli?

I have a c++/cli class in which I would like to maintain a mapping between a managed string and a native pointer. Using std::map gives the compiler Warning C4368 (cannot define 'member' as a member of managed 'type': mixed types are not…
user236520
4
votes
4 answers

Debug Managed and Unmanaged code together

My main startup project is in c++. the solution involves also managed c# code. When I debug - I have breakpoints only on the unmanaged sections (on managed breakpoint it states : "The breakpoint will not currently be hit. invalid file line " I…
Eyal
  • 289
  • 1
  • 5
  • 12
4
votes
4 answers

How much of .NET is unmanaged?

Frequently when I am using the Reflector, I come across lots of unsafe code. Anyone knows how much of .NET is unmanaged/safe?
Joan Venge
  • 315,713
  • 212
  • 479
  • 689
4
votes
3 answers

Getting at unmanaged C++ functions from C#

I have some ANSI standard C code which is authoritative. What that means is that although I have the source, I can not translate to another language nor modify calling arguments, as those actions would invalidate the authority. There are over 150…
Mark T
  • 3,464
  • 5
  • 31
  • 45
4
votes
2 answers

how to add a new compiler switch in bjam

I need to compile a library in managed c++ and looking into msvc.jam, I cannot find any feature that would add the /clr switch to my compile flags. How would I add such a feature? If possible, I would like to avoid modifying msvc.jam.
Eric Parayre
  • 43
  • 1
  • 3
4
votes
1 answer

Browse files dialog box using winforms and Managed C++

I am working on Managed C++ for the first time... I have made a form using Winform which has a button to browse through directories for file and whichever path the user selects, the path should be visible on the text box. I wanted to know how to…
tech_learner
  • 725
  • 11
  • 21
  • 31
4
votes
2 answers

Emphasize managed or unmanaged in a mixed C++ .NET app?

The app on which I work is a WinForms app written almost entirely in Visual C++ circa 2003. .NET was selected, prior to my arrival on the scene, because of the UI building framework, but the vast majority of code was developed in unmanaged land.…
user18329
  • 156
  • 2
  • 5
4
votes
2 answers

Handling an Unmanaged String in a C++/CLI Wrapper - BLOCK_TYPE_IS_VALID, _CrtIsValidHeapPointer

I'm new to C++/CLI but have been coding managed code for many years... apparently too many years. :) Attempting to write a wrapper for an unmanaged class provided by a 3rd party, and I'm seeing some strange stuff. I'm hoping you all can help me out…
Josh
  • 43
  • 1
  • 4
4
votes
2 answers

How to push data from unmanaged to managed code?

I am using a C++/CLI Wrapper to access a purely C++ library (-> unmanaged) from a C# framework (-> managed). I want to build in a mechanism which enables the C++ library to push information about its status towards the framework. In my understanding…
Jakob S.
  • 1,851
  • 2
  • 14
  • 29
4
votes
0 answers

How to read "com.apple.configuration.managed" Using MDM To Configure An Enterprise App Via UserDefaults - Swift 3 or 4

let serverConfig = UserDefaults.standard.dictionary(forKey: "com.apple.configuration.managed") print("serverConfig count: \(String(describing: serverConfig?.count))") Above code always returning nil for iOS 11 and above. but same code is working…
Tejas Shah
  • 106
  • 2
  • 8