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
2
votes
1 answer

Calling unmanaged code from a C# thread

I have an unmanaged C++ library for which I've created a managed C++ wrapper. I'm now trying to call this from C#. So far so good. However when I try to call the same code from within in a C# thread I get exceptions from within the unmanaged…
Richard Adams
  • 591
  • 1
  • 9
  • 23
2
votes
1 answer

Generate managed wrapper for Media Foundation

MF team has provided MFManagedEncode which is written in C#, inside the source they have created wrapper for a lot of MF interfaces but not all interfaces, is there have any tool can generate the wrapper for rest interfaces automatically? if no, i…
json
  • 57
  • 7
2
votes
4 answers

Defining custom managed service fails

We are trying to develop custom Intershop Managed Service following cookbook: https://support.intershop.com/kb/index.php/Display/2329T4 But when trying to enable service in Operations for our Organization, it is not listed there and there is a…
Goran Petanjek
  • 444
  • 2
  • 11
2
votes
2 answers

Need in understanding Exception at runtime in C++/CLI project execution

I am using Code from here, it is a simple code that allows Managed C# class to be used inside a C++ project with CLI bridge. And I am trying to get this working for my testing. But I get this exception : Unhandled exception at 0x00007FFDAA264008…
Syed Alam Abbas
  • 521
  • 6
  • 21
2
votes
1 answer

'ShowSUM': __declspec(dllexport) cannot be applied to a function with the __clrcall calling convention

I have a C# DLL with the following code: namespace Csharplib`{ public class Calculate { public static int Sum(String value1, String value2) { int res = int.Parse(value1) + int.Parse(value2); return res; } …
Uzair Raza
  • 55
  • 4
2
votes
0 answers

How to implement c++ class from C# using c++/CLI

After search all over the internet for a 3 days - I need your help. I am trying to implement c++ interface from c# (with CLI layer in middle of them). The problem (See in cli layer code in FrameGrabber_wrapper.cpp) is to call to Register(...) This…
Matan Marciano
  • 333
  • 4
  • 13
2
votes
2 answers

Importing x10 objects into java

We need to pass an x10 arraylist[string] to a Java method as an object. What we tried is this.The method signature in Java interface is as follows. public void getX10ArrayList ( ArrayList nameList): We implement that method inside an X10…
Nandula
  • 23
  • 4
2
votes
0 answers

How use LINQ in C++\CLI managed codes

There is a simple managed code in C++\CLI : cli::array^ ar= gcnew cli::array{"Stack","Over","Flow", "Over" }; Now i want to sort this array using with LINQ. How use LINQ in C++\CLI managed codes? In regular .net & c# language…
SilverLight
  • 19,668
  • 65
  • 192
  • 300
2
votes
1 answer

How to release partial DLL in .NET

I am used to deliver DLLs that built on top of several static libraries(.lib) in the unmanaged environment. Now I need to do similar thing but most lower level libraries are already managed DLLs. For security reasons, I don't want include every…
Icerman
  • 1,099
  • 4
  • 14
  • 30
2
votes
2 answers

Does space have to be allocated to ProcessStartInfo?

I am porting C++ code to C# and I came across this in the C++ code, SHELLEXECUTEINFO shell; memset(&shell, 0, sizeof(shell)); //the properties in shell are set ShellExecuteEx(&shell); So now I am using Process.Start() and ProcessStartInfo for the…
skwear
  • 563
  • 1
  • 5
  • 24
2
votes
1 answer

How to pass a string argument from C++ to a managed C# DLL

I'm writing a C++ program that needs to call a DLL written in C#. I followed these instructions for creating my C# DLL and linking in to it from my C++. https://support.microsoft.com/en-us/kb/828736 I have a C# function that takes a string as an…
stranger
  • 390
  • 4
  • 17
2
votes
1 answer

memory leak when using COM IDispatch::GetTypeInfo() in C#

I have the following function in a COM dll (C#, .NET framework v2): public void Leak(object jsObject) { Type comType; IDispatch disp = (IDispatch)jsObject; disp.GetTypeInfo(0, 0, out comType); // this line causes the leak …
ThiefMaster
  • 310,957
  • 84
  • 592
  • 636
2
votes
3 answers

Using unmanaged library

So in visual studio i have my solution with two projects, first one is managed c++ code and second one is unmanaged c++ library (waffles). I want to use classes from library in my managed code. If i simply add 'include "GMacros.h"', then i get…
spacevillain
  • 1,336
  • 1
  • 14
  • 25
2
votes
1 answer

Mapping of C++ specific features to C++/CLI

I’m writing a wrapper in C++/CLI (VS 2015) for given C++ code to use finally the generated managed dll in C#. Therefore I created a managed class which calls a native class. This native class links to the given C++ code due to a factory method which…
fantaghiro
  • 21
  • 2
2
votes
0 answers

Passing struct from managed to native, does it pin or copy

The question is general but I am actually doing this with Mono and not .net, so if there are differences, I am very interested in what they are. I have a simple data containing class (not struct for other reasons) which should be blitable in the…
JoeTaicoon
  • 1,383
  • 1
  • 12
  • 28