clr

VC++ Calling a function of /clr project from a function of non /clr project within a solution

风流意气都作罢 提交于 2019-12-09 18:21:23
问题 I referred this somewhat similar question before asking this, but unable to solve my problem I am looking at an old application with many solutions. The problem is happening in one of the solutions (say S). Here is the situation: A project (say P1) inside S has all C/C++ files and needs to call a C# function Since P1 also contains .c files, I can't use /clr option with that If I compile the .c files in P1 as .cpp files then it generates lots of errors, I don't intend to change the source in

Windows Form as child window of an unmanaged app

試著忘記壹切 提交于 2019-12-09 17:29:50
问题 I am looking for a way to embed Windows Forms applications written in C# in a C++ windows application. The native application main window is subdivided into several panes. The C# app is supposed to appear within one of those panes, i.e. the root window of the C# component (the outermost form) must be a child window of the main application. Can this be done? If so, how? Some additional context: To my knowledge, there are two ways to go about this. First, host the CLR in the native app by using

how to deploy the CLR functions in SQL server 2008

隐身守侯 提交于 2019-12-09 16:42:48
问题 I created a SQL Server Project in VS2008 called 'RegularExpression'.In that Project i created a 'Regex.cs' class and i wrote one function regarding Regular Expression. Then i Build the solution. Now My problem is to deploy this solution in SQL server 2008 through scripts.( not just clicking on Deploy in VS2008 ). I succeeded up to deploy the assmebly of that project in SQL 2008 using CREATE ASSEMBLY <AName> FROM '<path of .dll>' but iam not getting that function i wrote in VS2008 in SQL 2008

How to return an nvarchar(max) in a CLR UDF?

回眸只為那壹抹淺笑 提交于 2019-12-09 14:58:03
问题 Assuming following definition: /// <summary> /// Replaces each occurrence of sPattern in sInput with sReplace. This is done /// with the CLR: /// new RegEx(sPattern, RegexOptions.Multiline).Replace(sInput, sReplace). /// The result of the replacement is the return value. /// </summary> [SqlFunction(IsDeterministic = true)] public static SqlString FRegexReplace(string sInput, string sPattern, string sReplace) { return new Regex(sPattern, RegexOptions.Multiline).Replace(sInput, sReplace); }

Primitive types in .net

∥☆過路亽.° 提交于 2019-12-09 14:54:51
问题 In .net, AIUI int is just syntactic sugar for System.Int32 , which is a struct . csharp> typeof(System.Int32).IsPrimitive true csharp> typeof(System.Int32).Equals(typeof(int)) true I see in the source: https://github.com/mono/mono/blob/master/mcs/class/corlib/System/Int32.cs http://referencesource.microsoft.com/#mscorlib/system/int32.cs That System.Int32 is just defined with reference to a member m_value that is itself an int - how does that work? Surely we're defining int with reference to

Native Assembly Binding fails for ASP.NET solution

江枫思渺然 提交于 2019-12-09 14:47:15
问题 NOTE: This main purpose of the question to UNDERSTAND/EXPLAIN the assembly binding behavior of the CLR. The solution should be evident once the reason is pinned down. Please, know that I understand my setup is not optimal (nativedll not signed and versioned etc) but again I just want to investigate the binding behavior of the CLR. I am attempting to use a native (non-COM, C++) dll into my asp.net solution. I am going to refrain from naming the dll because I think it diverts the topic in the

What will it take to add Objective-C support to the .NET common language runtime?

时光毁灭记忆、已成空白 提交于 2019-12-09 08:28:37
问题 Is it possible for the .NET CLR to support Objective-C? Are there any reasons (either from a legal or implementational) standpoint why this wouldn't be possible? In the spirit of cross-platform application development, it would be nice to be able to write and run Objective-c applications on Windows machines. At least i think it would. 回答1: Objective-C is a strict superset of C. As such, it's got a lot of features like pointers that translate poorly onto .NET. Of course, it may be that -- in

Are .NET threads different from operating system threads?

╄→尐↘猪︶ㄣ 提交于 2019-12-09 08:19:09
问题 Are .NET threads lightweight user-mode threads or are they kernel-mode operating system threads? Also, sparing SQL Server, is there a one-to-one correspondence between a .NET thread an an operating system thread? I am also intrigued because the Thread class that has a symmetric pair of methods named BeginThreadAffinity and EndThreadAffinity, whose documentation subtly suggests that .NET threads are lightweight abstractions over real operating system threads. Also, I read a while ago on some

Can WinDBG be made to find mscordacwks.dll in the symbol store?

心已入冬 提交于 2019-12-09 06:09:40
问题 The Question There are plenty of manual ways to make WinDBG find mscordacwks.dll without a symbol store (putting the file in the path somewhere, putting it in the same folder as windbg.exe, putting it in my Framework\v folder, specifying the path in WinDBG using .cordll -lp c:\dacFolder , etc.), but they all only fix it for me . I need to fix it more generally for everyone who uses my symbol store . The possible solutions I can imagine are: WinDBG be made to check the symbol store using

What are the situations or pros and cons to use of C++/CLI over C#

流过昼夜 提交于 2019-12-09 05:45:56
问题 I have been keeping up with .NET CLR for awhile now, and my language of choice is C#. Up until recently, I was unaware that C++/CLI could produce "mixed mode" executables capable of running native and managed code. Now knowing this, another developer friend of mine were discussing this attribute and trying to determine when and how this ability would be useful. I take it as a given that native code has the capability to be more efficient and powerful than managed code, at the expense of