Click here to Skip to main content
15,889,281 members
Everything / CLR

CLR

CLR

Great Reads

by matt warren
Fortunately, there’s a fantastic tool that makes it very easy for us to get an overview of memory usage within the CLR itself. It’s called VMMap and it’s part of the excellent Sysinternals Suite.
by Graeme_Grant
This is an alternative for "Simplest WPF Dependency Property For Beginners On Background Color"
by Martin Lachman
How to create a system on MS SQL Server for detection of actual changed records in a database table.
by matt warren
A while ago I wrote about the 'special relationship' that exists between Strings and the CLR, well it turns out that Arrays and the CLR have an even deeper one

Latest Articles

by Bruno van Dooren
Ways to deal with changed security for CLR code in SQL databases
by wmjordan
Do something crazy and dangerous with CLR and a method made from Dynamic Assembly
by DiponRoy
Creating CLR in SQL Server
by Mohammed Abdulla (ABSS)
Step by step procedure to xcopy deploy .NET assembly into fox-pro application

All Articles

Sort by Updated

CLR 

26 May 2023 by Saurabh Ashtaputre
I have a C# WPF User Control DLL. I want to show this User Control over a C++ MFC UI. For communication between them I am using C++ COM DLL (CLR enabled for this VS project). The IDL file has an entry for the COM function like this: [local]...
26 May 2023 by JudyL_MD
I think you need to put an out on the C# method itself so the compiler knows to pass the changed value back to the caller. Without the out, the changes to the parameter variable are only visible within the method.
4 May 2023 by Bruno van Dooren
Ways to deal with changed security for CLR code in SQL databases
17 Apr 2023 by Member 15849100
Confirm the URL Is Correct. This might sound obvious, but the 401 error code might appear if the user entered the wrong URL in the browser's address bar. ... Clear User End Issues. ... Check Authentication Credentials. ... Disable...
12 Mar 2023 by sahil ajmeri 2022
i have created CLR winforms(.net framework) c++ project, there's two buttons SelectImageBtn and EnhanceBn. i want to select the folder where the blur images are stored by clicking SelectImageBtn and want to sharp and enhance all the blur images...
12 Mar 2023 by merano99
The /std option is used to control version-specific standard features of the ISO C or C++ programming language in a compiler. https://learn.microsoft.com/en-us/cpp/build/reference/std-specify-language-standard-version However, according to your...
10 Mar 2023 by sahil ajmeri 2022
okay i found the solutions for getting errors i was using ISO C++14 Standard (/std:c++14) instead of upgraded version ISO C++17 Standard (/std:c++17) i fix the problem following steps To switch to C++17 or later, you need to modify the...
9 Mar 2023 by k5054
As Richard notes, there's no GUI for the console. However there are a number of TUI libraries out there that may help with things like dialogs, pull-down menus, etc, like this one: GitHub - magiblot/tvision: A modern port of Turbo Vision 2.0,...
9 Mar 2023 by Member 14594285
I created a empty project clr that calls a c# library..it works but it's a console application: #using "consume_cs_indexers.dll" //#include "DlgClass.h" using namespace System; int main() { IndexerClass ^ ic = gcnew IndexerClass; int...
9 Mar 2023 by Richard MacCutchan
Console applications do not have a UI, they are simple terminal style applications with text in and out. If you want to use UI compomnents then you need to create a UI application: WindowsForm, WPF, UWP etc. Both Microsoft and CodeProject have...
30 Jan 2023 by Bal krishna sharma
After post username and password one token generate that token I want to authrize in another method to break bearer What I have tried: #include #include "WinHttpWrapper.h" #include void PrintDictionary(const...
24 Jan 2023 by Bal krishna sharma
Actually 500 bad request is shown in the time of Http request method is run using namespace std; const wstring domain = L"localhost"; const wstring requestHeader = L"Content-Type: application/json"; int port = 7276; bool https = true; ...
18 Sep 2022 by Death Smoke
#pragma once #include using namespace std; namespace Project1 { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace...
28 Jun 2022 by code_pop
Hi all. I'm using the C++/CLI dll on the C# WinForm project. To pass from the native code's exception message to C#, I have written the code as below. #include "pch.h" #include "ClassLibrary1.h" using namespace ClassLibrary1; void...
9 Dec 2021 by codefast1993
I have a mixed mode dll (C++/Cli) that is referenced in a C# application. It crashes with the error: name_here.dll has caused an access violation exception(0xC0000005) when trying to read from memory location 0x00000000 on thread 243. What I...
19 May 2021 by dj4400
Hi, I have a native c++ app. that uses a clr/cli wrapper to call a c# dll function. The solution is built in VS.2017, using the platform toolset of vs2010(v100) and includes the native c++ project, the clr/cli wrapper project and the c# dll...
19 May 2021 by Dave Kreskowiak
That's not an exception. It's just a debugger message that says it cannot load the symbols from the PDB file for the wkernelbase assembly. There's nothing to worry about there. If you want to get rid of it, you can enable automatically...
2 Feb 2021 by MohammadrezaMC2
Hello I am trying to convert a 2d CLR array to a single pointer array in C++. here is my code: array^>^ myarray = { {1,2,3,4}, {5,6,7,8} }; pin_ptr p = &myarray[0][0]; double* R = p; for (size_t i = 0; i
2 Feb 2021 by Shao Voon Wong
You do not need to pin. Just assign one element at a time to the native mat variable, R. array^>^ myarray = { {1,2,3,4}, {5,6,7,8} }; mat R(2,4); for (size_t i = 0; i
27 Nov 2020 by Member 15003852
I am an intermediate in VC++ and trying to accomplish the following:- 1. Dock a timer created using Windows forms to the extreme right of the taskbar (and to the left of the notification area or system tray). 2. Make it responsive (match its...
16 Nov 2020 by Richard Deeming
You'll need to create the CLR assembly with UNSAFE permissions to send email. Creating an Assembly - SQL Server | Microsoft Docs[^]
15 Nov 2020 by John Robert Connolly
I have created a CLR that is in vb and is very basic: It send out smtp emails and has one import: Imports System.Net.Mail I created the assemble successfully and I can run the CLR Code but when I do I get the following error message below: ...
16 Dec 2019 by Rick York
No, one should not call main from anywhere. It is the designated entry point for CLI programs. For GUI programs in windows the entry point is WinMain. This is a bit confusing. How is it you have a button in a window with a CLI program? If you want to learn how to use OpenGL in a WinForms...
16 Dec 2019 by SIDHARTH S
Is it possible to call the function int main(int argc, char **argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH); glutInitWindowSize(500, 500); glutInitWindowPosition(100, 100); glutCreateWindow("Window"); glutDisplayFunc(display); ...
5 Nov 2019 by St0rmi
You can debug Code in SQL Server, but if you don't know how here's an alternative: Simply add a counter to your procedure and a try catch block to see where the error occurs: int i; i = 0; try { i = 1; ...some code i = 2; ...
5 Nov 2019 by ahmed_sa
Problem I work on sql server 2012 when implement clr function i get error Msg 6522, Level 16, State 1, Line 1 A .NET Framework error occurred during execution of user-defined routine or aggregate "spExecuteParallel": System.NullReferenceException: Object reference not set to an instance of an...
4 Nov 2019 by OriginalGriff
This is one of the most common problems we get asked, and it's also the one we are least equipped to answer, but you are most equipped to answer yourself. Let me just explain what the error means: You have tried to use a variable, property, or a method return value but it contains null - which...
23 Oct 2019 by wmjordan
Do something crazy and dangerous with CLR and a method made from Dynamic Assembly
20 Oct 2019 by B-Koronfol
Hello Everybody. I developed Multi-column ComboBox and I used the first item in it to use it as a button to add a new item to the ComboBox as needed, I named the linked property NewItemButtonCaption. Till now everything is okay, after that I used that Multi-column CoboBox to create custom...
20 Oct 2019 by B-Koronfol
I solved it, and this is the full solution: [ToolboxItem(false)] public class MCCBEditingControl : MultiColumnsComboBox, IDataGridViewEditingControl { private DataGridView _DataGridView; public MCCBEditingControl() { } public DataGridView...
17 Oct 2019 by RickZeeland
Maybe this article will be of help: Build a Custom RadioButton Cell and Column for the DataGridView Control | Microsoft Docs[^]
16 Oct 2019 by Dan Sutton
When I create a CLR Table-valued function in C# returning IEnumerable, to return rows of data, and the table definition contains a decimal (e.g. "decimal(10,4)") values seem to be rounded to integer values when they're actually produced: the data type is still decimal(10,4) but the value will...
21 Jul 2019 by Zon-cpp
Hi, my project is a clr (VC++) project. i want to debug and to trace my code ( in debug mode) but as soon as i call da->Fill(dS, L"tlbReferalPersonInfo"); then i can't see value of objects. for example in my code bellow (in debug mode) : int otherVal = 10; SqlCommand^ cmd = gcnew...
21 Jul 2019 by OriginalGriff
Fill is a "blocking call" - it doesn't return until the DB has assembled all information and returned it to your application (or the SQL timeout expires, whichever happens first). So if your stored procedure takes a long time, you can't do anything else on that thread - including use the...
4 Jul 2019 by Divya B Nair
Hi, I have a .Net library which checks if a WCF service is up and running. Below is the function I have used. public string VerifySiteExists(string wcfurl) { HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(wcfurl); httpReq.AllowAutoRedirect = false; HttpWebResponse...
2 Jul 2019 by DiponRoy
Creating CLR in SQL Server
12 May 2019 by Richard MacCutchan
This is the same question as How to check dllmain function is returning false[^]. Please do not repost.
4 Apr 2019 by Member 14150165
I'm new to managed C++, dealing now with a C++/CLI project which involved function calling from native DLL for results to be displayed via WinForm. An expected exception is encountered when calling function from native DLL due to missing equipment for the project. However, instead of...
11 Mar 2019 by Member 10068530
I want to consume c++17 modules from managed clr/c++ code. Is it possible? What I have tried: I have built a dll with c++ modules. Consumed it from a console application without turning /clr. Everything worked. Once i turn on /clr switch, it does not work. My clr console application has...
11 Mar 2019 by steveb
There are many ways you can do that: 1. Implement your C++ 17 as DLL and export "C" function interface. There are ton of material on google how to call DLLs from CLR or .Net langs. 2. Implement as COM DLL. This one can be called by any language VB, C#, C++, C etc 3. Implement as COM EXE server....
22 Oct 2018 by Bartje_
I think it could be one of two things: Use the Application.Run method to start the form (More info: Application.Run Method (System.Windows.Forms) | Microsoft Docs ) Or try adding the STAThread attribute to your EntryPoint method (More info: STAThreadAttribute ) According to the documentation...
22 Oct 2018 by Member 13911570
I have a C++ dll which is calling my C# code after an injection with CLR. So this is my C++ (dll) code: #include "stdafx.h" #include #include #include #include #pragma comment(lib, "mscoree.lib") #define IfFailRet(expr) { hr =...
1 Sep 2018 by Member 13969232
I have Database on localhost (xampp, mysql). I have some symbols cyrillics (russian symbols). All fields of database are setting as utf8mb4_general_ci. From Database I receive data to application CLR windows form (visual studio). It's work correctly. If I try change data at database from...
13 Aug 2018 by felipebsuardi
Just add the EntityFramework as "Code First from database" and not as "EF Designer from database". This resolved my problem, but it has a dark side, if you change your database you have to remove all the classes and add it again, or just edit the classes, I use the last when I change properties...
13 Aug 2018 by Shashangka Shekhar
Schema specified is not valid. Errors:The mapping of CLR type to EDM type is ambiguous because multiple CLR types match the EDM type 'CmnAddressCity'.Previously found CLR type 'ABS.Models.Sales.CmnAddressCity',newly found CLR type 'ABS.Models.SystemTools.CmnAddressCity'.Is there any...
1 Jun 2018 by Dave Kreskowiak
The .EXE has the IL in it. There is a normal "header" in the executable that loads the .NET CLR. The application code is not compiled to native CPU code. The .NET CLR JIT compiler will load the IL code, compile it to native code for the CPU it's running on, cache that native code, then the CPU...
1 Jun 2018 by Vedavyas Velaga
I have an exe file named Addition.exe which will prompt user to enter two numbers and it will display the sum. Once the developer developed the code he will build the code with the respective language compiler compiled it to IL. My doubt here is 1)does the exe file contains this IL code or...
11 May 2018 by Dave Kreskowiak
You cannot use assemblies in your app that target a Framework version higher than the one your app is targeting. While you may find cases were this will work, there are plenty of cases where it won't, and it seems you just found one. This is specially so if your app is targeting .NET 2.0, 3.0,...
11 May 2018 by RedDk
I haven't asked a question for a long time but these two are so prescient that I'd be very surprised if the matter hadn't come up at some time in the experiences of many if not most CPians here at some point in their experiences using Visual Studio. First, has anyone ever BROWSED (not made an...
5 Mar 2018 by Member 13709204
I want to search for a software, example:Microsoft Word, and open it by using a windows forms application in C++ CLR. Please help me... What I have tried: Process::Start("%STARTMENU%//notepad.exe");
5 Mar 2018 by OriginalGriff
That's harder than you might think: executing the app is simple - as you've seen it's just a case of providing Process::Start with a path to the Exe file. The problem is searching - not all app EXE's have the same name as the executable. For example, "Microsoft Word" is in the file...
19 Feb 2018 by phil.o
Your problem does not seem to be in the structure declaration, but rather where you try to use it. The code you showed does not hold any cfg identifier. Find this identifier in your code, you most likely forgot to terminate one of your statements with a semicolon.
19 Feb 2018 by Vishal Bhatia0112
Hello All, It's an C++/CLR project. I have below structure in my header file: value struct CONFIG { System::String^ Exch_Feeds; System::String^ Exch_Type; System::String^ Feeds_Type; int Feeds_port; int Max_Users; int IML_port; System::String^ Interface_IP; System::String^...
11 Feb 2018 by #realJSOP
There is no need to use MFC from C#. Here's a link that describes the FtpWebRequest object. MSDN Docs for FtpWebRequest [^] Furthermore, there are numerous C# FTP classes, many of which are posted as articles right here on CodeProject. EDIT================================= Look at this Q/A...
9 Feb 2018 by Elgin76
I am writing an application using C# and XAML that needs to access FTP functions. Most, but not all, are provided by FtpWebRequestMethods.Ftp class. What is missing is the ability to execute commands on the remote server. This functionality is available in MFC using the CFtpConnection Class. ...
4 Feb 2018 by Zon-cpp
Hi Can I have a ".lib" from class library VC++ project (CLR VC++ project)? I want to use this file (.lib) in MFC and unmanaged project. Is there a way? What I have tried: I want to use CLR (vc++ class library) in MFC (VC++) project.
4 Feb 2018 by Richard MacCutchan
.net library from MFC - Google Search[^]
29 Jan 2018 by Mohammed Abdulla (ABSS)
Step by step procedure to xcopy deploy .NET assembly into fox-pro application
24 Jan 2018 by VR Karthikeyan
Hello, I hope the following discussions will help you, 1. Is there a performance difference between WPF and Winforms? - Stack Overflow[^] 2. Performance | Microsoft Docs[^] 3. WPF vs Windows Forms | Tales from a Trading Desk[^]
24 Jan 2018 by Vishal Bhatia0112
Hello Everyone, Namaste. We are starting to build an application whioch will be having more gridview controls. We are opting for CLR or WPF, which one is better in my case (For Gridview). And is WPF still lacking in grid forms? What I have tried: Still more interested in WPF cause of it's...
22 Nov 2017 by Graeme_Grant
This is an alternative for "Simplest WPF Dependency Property For Beginners On Background Color"
5 Sep 2017 by Member 10262330
I developed this DLL to have a more powerful utility and to simplify SP and query.
2 Aug 2017 by matt warren
It’s a fundamental part of .NET and can often happen without you knowing, but how does it actually work? What is the .NET Runtime doing to make boxing possible?
20 Jul 2017 by Ehsan Sajjad
Hi, Reading book CLR via C# on page 124 there is discussion about altering Layout kind for value types for Inter-Operability and there is example quoted which uses same FieldOffSet for multiple fields. What I have tried: I understand the the memory of both fields overlap and modifying one...
20 Jul 2017 by Afzaal Ahmad Zeeshan
Hmmm, interesting question, but this takes a lot of things back to the old schools and might require some low-level stuff to be discussed, which I personally ignore when it comes to C#. First thing to realize is, that you only want to rearrange the bits and their locations if you know exactly...
11 Jul 2017 by Doug Duerner, Yeon-Chang Wang
In this article we explored a theory; would it be better to not utilize a heap construct when dealing with very large objects in .NET, in order to avoid Large Object Heap (LOH) fragmentation?
10 Jul 2017 by matt warren
Fortunately, there’s a fantastic tool that makes it very easy for us to get an overview of memory usage within the CLR itself. It’s called VMMap and it’s part of the excellent Sysinternals Suite.
16 May 2017 by matt warren
A while ago I wrote about the 'special relationship' that exists between Strings and the CLR, well it turns out that Arrays and the CLR have an even deeper one
14 May 2017 by Member 13198641
If 'Girl' is selected in the combobox by the user, how can i get 'the girl got in her car'or any other string displayed in a richtextbox on the same form looking for the syntax and right way to implement this, thank you What I have tried: Ive looked at multiple pdf's and youtube videos. I can...
14 May 2017 by KarstenK
You must implement a message handler for CBN_SELCHANGE notification and in the handler function you can set the text of your control. Read the article Using the CComboBox control to find some explanations.
6 Apr 2017 by matt warren
Here is a list of 68 things that the CLR does before executing a single line of your code
20 Mar 2017 by VINODKUMAR T
C# Compiler Options[^]For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.The compiler produces executable (.exe) files, dynamic-link libraries (.dll), or code modules (.netmodule).Every compiler option is available in two forms: -option and...
13 Mar 2017 by MK-Gii
Anyone have any ideas if there is a simple way to measure how much memory a certain part of application is consuming?For example I got an application that load text files, processes these and takes another one. I need to measure how much memory the single file processing took.I know I could...
13 Mar 2017 by Dominic Abraham
Have you tried using the below method ?GC.GetTotalMemory(true) This you can use at start / end of the method and get the difference.RegardsDominic
10 Feb 2017 by Member 12964788
Hello ,i am working on project where i have to write array output to text box using win from . e.g i have data coming in an array and find the minimum value find its location and correspondingly write a character or integer to text box. if (location == 1) print f("letter is...
10 Feb 2017 by Member 12845461
https://www.codeproject.com/Qu...
9 Feb 2017 by CPallini
I assume you want to use C++/CLI on Windows Forms. See Microsoft Visual C++/CLI - Windows Controls: The Text Box[^]
18 Jan 2017 by Doug Langston
A Visual Studio 2015 project that shows one way to pass information between Windows Forms
28 Oct 2016 by Pavel Sinkevich
If data source is populated manually, there is a typical problem: a mix of visually similar Cyrillic and Latin letters. This tip describes how to fix it.
4 Oct 2016 by Martin Lachman
How to create a system on MS SQL Server for detection of actual changed records in a database table.
18 May 2016 by Manzoor Ahmed P
We use the same key i.e 'using' for including the name space and also to call the Dispose method on the object like...using System.Object;andusing (SqlConnection conn = new SqlConnection(connString)){ ...}My question is how the compiler will know for what purpose the keyword...
18 May 2016 by F-ES Sitecore
It does it by context. If the keyword is outside of a class\method it assumes you are doing the namespace version, if the keyword is inside a class it assumes it is the object dispose version.
18 May 2016 by Zafar Sultan
1. As a directive(shortcut for namespaces):System.Data.SqlClient.SqlConnection myCon = new System.Data.SqlClient.SqlConnection(connectionString);To simplify the above statement just write:using System.Data.SqlClient; before any declaration(on very top of the class) and then you may write...
24 Apr 2016 by praveen iThesisArt
If I make any object for example :Emp obj= new Emp();So who clr , system(OS) or garbage collector will allocate memory to obj object in heap ?1. Extract 1 :Which concludes garbage collector is responsible.From micorsoft link -
24 Apr 2016 by OriginalGriff
Both: the Garbage Collector is part of the CLR and works to clean up after you and free memory. It is in control of the Heap and it's free memory lists, so it also does the allocation of memory: Automatic Memory Management[^]The system allocates the memory to start with when your app starts...
15 Apr 2016 by Member 10185036
I need to use my C++ dll in C# application. I created a wrapper project in CLR and linked with C# app.I am getting random crashes while accessing the memory created in c# application in my CLR wrapper methods and sometimes in my C++ dll project. I am sure my dll project is a foolproof...
15 Apr 2016 by KarstenK
you must allocate real memory for your arrayint[] MyArray = new int[3];I dont think you need it, but it makes your intention clearerfixed (int* pointer = MyArray){ A_Wrap Wrapper = new A_Wrap(); Wrapper.CLRDllMethod(pointer); //all stuff with the array}
23 Mar 2016 by Sergey Alexandrovich Kryukov
Most likely, you simply should not delete the file the user don't have permission to delete. This would be the best solution in most cases. Know legitimate directories and files, and those which you should not touch.But now, let's consider the cases when you really need to delete the file...
23 Mar 2016 by vilish.shah
I am am learning CLR And would like to delete file from SQL SP File located are on different server.Any help would be much appropriated.Thanks in Advance.What I have tried:i have tried following code and complied.Imports System.IO Public Class CLRFunctions ...
21 Mar 2016 by CHill60
You have already received an answer to your post on C# Corner which directs you to this post - c# - The mapping of CLR type to EDM type is ambiguous with EF 6 & 5? - Stack Overflow[^]
30 Jan 2016 by OriginalGriff
Don't post this as a separate question - add it to your original one, so all the information is together - otherwise different people get different bits and nobody sees it all.This time, I've done it for you, and I'll delete this one...
24 Jan 2016 by Dmitry Orzhevsky
This article dives into .NET method inlining topic and shed some light on one particular case when CLR is more likely to inline method - looping.
3 Jan 2016 by Sergey Alexandrovich Kryukov
Unfortunately, both Solution 1 or 2 are off-topic. They don't tell you a word on how build your own language with the "real" compiler. You need to compile from your language to CIL, and nothing else. Compilation to C#, being quite possible, will be, first of all, inefficient (extra compilation...
3 Jan 2016 by Abhinav S
There is a read on Domain Specific Langauges here[^]. Maybe it can help you.
3 Jan 2016 by Thomas Daniels
For the compiler: as the language you want to create would be based on C#, the easiest way to create it might be to compile your language into C#, and compile the C# into an executable. To compile C# code to an executable, take a look here:How to programmatically compile code using C#...
3 Jan 2016 by Adrian Andrei
Hi! I want to create my own programming language based on c#.Does anyone know how can I do it?I searched on google and I found nothing...I want my own language to support:Syntax Highlight, Intellisense and to be compiled to CLR and to support all .net features and to work in Visual...
28 Dec 2015 by Dmitry Orzhevsky
This article describes a set of tools and techniques which can be used to find memory allocation problems in .NET code and help significantly boost your app performance.
24 Dec 2015 by ZurdoDev
A simple google search shows how to register your assembly. See Exact Help: How to transfer or create CLR stored procedure from one database to other database in sql server[^] for an example.