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
8
votes
5 answers

Why do we need/use managed code (over native)?

I'm missing something basic here. What's the use of compiling from a source language into bytecode (java) or intermediate language (.NET) and then running them from inside the JVM or CLR ? There's the decrease in performance (however slight or…
Arctic Vowel
  • 1,492
  • 1
  • 22
  • 34
8
votes
3 answers

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

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…
user343400
  • 171
  • 1
  • 3
8
votes
1 answer

How to use SQLite on new Windows 8.1 Store app (Visual Studio 2013)

So, I installed Visual Studio 2013 on my Windows 8.1 box. I want to experiment with it and created a new Windows Store Grid App. I want to persist data on a SQLite database, apparently the database of choice for WinRT apps. Quickly found links to…
johnildergleidisson
  • 2,087
  • 3
  • 30
  • 50
8
votes
4 answers

Oracle Managed ODP.NET can't find tnsnames.ora

My managed ODP.net webapp works locally but when deploying it to a server, it fails with the error: "TNS:listener does not currently know of service requested in connect descriptor" From looking around, it seems like this is because it can't get to…
SeanKilleen
  • 8,809
  • 17
  • 80
  • 133
8
votes
3 answers

Stepping through Source Code using Windbg SOS Extension

I have recently switched from native to managed code programming. I am using .NET. Since i have been using Windbg for quite some time , i want to use it for managed code debugging as well. My search has brought me to the SOS (Son of Strike)…
Dev28
  • 497
  • 5
  • 16
7
votes
2 answers

CoCreateInstance returns "Class not registered"

I've been at this for hours now and it's starting to get upsetting. :( I have a COM DLL that I created in .NET 4.0, that I want to be able to access with a legacy application made in VC++ 6. Its visible to COM, I already successfully created the TLB…
kogh
  • 995
  • 4
  • 17
  • 30
7
votes
6 answers

In managed code, what should I look after to keep good performance?

I am originally a native C++ programmer, in C++ every process in your program is bound to your code, i.e, nothing happens unless you want it to happen. And every bit of memory is allocated (and deallocated) according to what you wrote. So,…
Tamer Shlash
  • 9,314
  • 5
  • 44
  • 82
7
votes
2 answers

Best way to call Managed .NET code from Unmanaged code

I'm trying to find the best performing method of calling into Managed .NET code from Unmanaged C++ code. I have found information on Hosting .NET within my C++ application and I'm able to create a pRuntimeHost and start it without a problem. The…
Andrew Stern
  • 688
  • 9
  • 18
7
votes
4 answers

Calling SSE code in managed code (alignment)

Here's my problem: We have a math library written in C++ that is heavily using SSE. We need to use that same math library in our the managed layer of our tools (which are written in C#). The problem is, that the math library classes must be 16-byte…
Jan
  • 113
  • 6
7
votes
2 answers

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

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…
Amir Saniyan
  • 13,014
  • 20
  • 92
  • 137
7
votes
1 answer

Recover containing GC object from managed 'ref' interior pointer

This question is newly relevant in light of the new ref locals and ref return features in the latest versions of C# 7: With the increased prominence and wider use of managed--or "interior"--pointer variables in C#, occasionally you may need to…
Glenn Slayden
  • 17,543
  • 3
  • 114
  • 108
7
votes
0 answers

How to communicate with hosted CoreCLR?

.NET Framework presents several methods of hosting managed runtime. One can use mscoree.dll's CorBindToRuntime (https://msdn.microsoft.com/library/ms231419(v=vs.110).aspx) to get handle of AppDomain via GetDefaultDomain/CreateDomain, and then load…
Andrey Paramonov
  • 409
  • 4
  • 11
7
votes
0 answers

C++/CLI Module Initializer for managed code

Is it possible to run managed initialization code for a c++/cli dynamic library? I have a large collection of managed classes all wrapping underlying unmanaged functionality, used by many different solutions. I now need to call some managed code…
user2299700
  • 101
  • 1
  • 2
7
votes
3 answers

What is the best way to support multiple architectures in a mixed managed/unmanaged environment?

Background We have a .NET library that is referencing one of our unmanaged dlls, lets say: DotNet.dll Unmanaged.dll Thus far, Unmanaged.dll is only 32-bit, so the DotNet.dll is marked with 32-bit CPU type. 64-bit support needs to be added. How to…
earlNameless
  • 2,878
  • 20
  • 25
7
votes
2 answers

Is it possible to call unmanaged code using C# reflection from managed code?

Is it possible using reflection and C# .NET to call dynamically different function (with arguments) written in C or C++ before .NET came (unmanaged code) ? A small C# example if possible would be appreciated!
milan
  • 213
  • 3
  • 10