managed

Why does my multithreaded C++ .NET application only crash when executed outside of visual studios?

旧巷老猫 提交于 2019-12-10 10:26:05
问题 I have created a very simple C++ .NET application using both managed and unmanaged code to replicate my problem. When the user clicks a button a new thread should spawn and do some time-consuming tasks while calling back to my main thread with status updates. This code compiles and successfully executes from within side of Visual Studios Express 2010. That is, when I click the "play" button, my project builds and executes without crashing. However, if I go to the Release folder where the

Using Java JAR file in .NET

落花浮王杯 提交于 2019-12-10 03:48:55
问题 What options/methods/software are available to convert a JAR file to a managed .NET assembly? Please provide all commercial and non-commercial methods in the answer. These don't include solutions which require Java to be installed on the host machine. 回答1: I could be wrong, but I'm pretty sure that's impossible. The java byte code is different to the code produced to run on the CLR. Snarky answer : Get the source code, and port it. EDIT: A little poking comes up with http://sourceforge.net

C# NHibernate & Oracle Managed Client

谁说我不能喝 提交于 2019-12-09 16:45:32
问题 I have a big project that conceals another 16 project (Tests, Webs & App like Core, Email etc:.). I use C# MVC4 for my main website project. If I use a non Managed Client need me to do a project folder /bin recorded library Oracle.DataAccess.dll and everything works fine ( I must set(change) in Web.config -> param: <connectionStrings> <add name="PC13" connectionString="User Id=TEST; Password=TEST; Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=DBTEST)(PORT=1521))(CONNECT_DATA=(SERVER =

How do I do typeof(int) in Managed C++?

廉价感情. 提交于 2019-12-09 14:01:59
问题 I am working on a project now and part of it uses Managed C++. In the managed C++ code, I am creating a DataTable. While defining the Columns for the datatable, I need to specify the Type of the column. In C#, that would: typeof(int) but how do I do that in Managed C++? Thanks! 回答1: In C++/CLI, use the typeid keyword. e.g. Type ^t = Int32::typeid; In the older "Managed C++ Extensions" syntax, you'd use __typeof(Int32) , but that whole version of the language is severely deprecated and you

How to get unmanaged variable-length C-array within a struct from C to C#?

自作多情 提交于 2019-12-08 07:49:06
问题 How do I return the MIB_IPFORWARDROW array? struct MIB_IPFORWARDTABLE { public uint Size; [MarshalAs(/* what goes here? */)] public IPFORWARDROW[] Table; }; [DllImport("iphlpapi", CharSet = CharSet.Auto)] private static extern int GetIpForwardTable( IntPtr /* MIB_IPFORWARDTABLE* */ pIpForwardTable, ref uint /* ULONG* */ pdwSize, bool bOrder); public static MIB_IPFORWARDROW[] Temp() { var fwdTable = IntPtr.Zero; uint size = 0; var result = GetIpForwardTable(fwdTable, ref size, true); fwdTable

Destructors not executed (no stack unwinding) when exception is thrown

淺唱寂寞╮ 提交于 2019-12-08 06:24:31
问题 I found a very very weird behaviour that I have never seen before. I'm working on a complex VS2005 C++ project. class Tester { public: Tester() { TRACE("Construct Tester"); } ~Tester() { TRACE("~Destruct Tester"); } }; void Thrower() { Tester X; throw std::exception("Booom"); } What do you expect to see in Trace output when Thrower() is called? That Tester is constructed and then destructed when the stack is unwinded, or not? At least I expect that, but the destructor of Tester is never

C# exception thrown from a C++ managed dll - EEFileLoadException * __ptr64

旧街凉风 提交于 2019-12-08 05:06:42
问题 I get this error from within a normal C# console program that's consuming a DLL produced as the build output of a C++ CLI project. There I have a simple DumbThing public ref class with a static method. I'd like to simply call that function or at least instantiate one tiny DumbThing object and see that C# can call code that it gets from a C++ CLI born DLL, but it's not working as it throws an error that puzzles me even more: First-chance exception at 0x000007fefd2acacd (KernelBase.dll) in

JSF Managed bean in jar not instantiated

别等时光非礼了梦想. 提交于 2019-12-07 23:06:49
问题 I have created two jsf projects in JSF. One of them is a base project that has a single session bean. This base project is packaged into a .jar file (with a /META-INF/faces-config.xml file) and included in the other project (the clientproj). The problem is that when I run the client project, the session bean in the base project is not instantiated, and I get a NullPointerException. Details are as follows: Base Project - Session Bean package sbeans; import javax.faces.bean.ManagedBean; import

Injecting a managed dll into a native process

∥☆過路亽.° 提交于 2019-12-07 21:06:11
问题 I'm trying to inject a managed c# dll into a native executable. I'm injecting the following code into the executable in order to load the CLR. I know the injection works, because when I inject the code into cmd.exe it outputs correctly. I know that CLRCreateInstance, pMetaHost->GetRuntime, pRuntimeInfo->GetInterface all return S_OK, but pClrRuntimeHost->Start() returns E_FAIL. This only happens when I inject the dll into a remote process. If I load the dll on my own process and call Main from

C++/CLI or C# for creating fast, modern and responsive GUI on Windows [closed]

对着背影说爱祢 提交于 2019-12-07 14:28:03
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 years ago . Currently I am split between these two languages. I'm almost halfway through programming my current application which needs to be very fast. It calculates insulated glass structures of any kind in multiple load-conditions. I just do not know if its the right choice to write