Click here to Skip to main content
15,891,248 members
Everything / Programming Languages / C++/CLI

C++/CLI

C++/CLI

Great Reads

by Dark Daskin
Article describes how to build an assembly that exposes functions to unmanaged code without C++/CLI
by Stoyan Damov
Internet File System from scratch - making web services and peer-to-peer technology work together to build a virtual file system
by Nish Nishant
Demonstrates the usage of splitters, treeviews, listviews, panels, toolbars
by Alexey
The ALXGrid Control Library is a set of classes for management of data as a table.

Latest Articles

by Mark Birbeck
Easily and quickly build web services clients using XForm
by Shao Voon Wong
Consuming Your C# Library in MFC/C++ Project via C++/CLI
by Mehul Donga
Handle managed (C#) event in managed (C++/CLI)
by Abhineet Ayan Verma
Major calling conventions for Win32 and best suited functions

All Articles

Sort by Updated

C++/CLI 

22 Jan 2010 by #realJSOP
Yes. You have to write an unmanaged DLL, and then use InteropServices in your managed assembly to get to the DLLs functionality.
16 Feb 2010 by #realJSOP
Google will set you free.Among others...http://www.softwareverify.com/cpp/memory/index.html[^]
18 Aug 2010 by #realJSOP
shiva's answer is almost there. When you try to open the file, use FileShare.None. If the file is already open, attempting to open the file with FileShare.None with throw an exception that you can react to.
23 Aug 2010 by #realJSOP
Vista doesn't allow you to make changes to any folder in the Program Files folder. You have to use one of the special folders for Vista and later.Google this and pick your poison from the returned results set:"C++ vista special folders"EDIT -------You can make your setup program...
24 Sep 2010 by #realJSOP
Execute the appropriate windows command line application with the necessary parameters.
28 Nov 2010 by #realJSOP
Look at the definition of MyForm in your project, and you'll see exactly how to do it.
3 Dec 2010 by #realJSOP
We don't do homework for people. It's not that we feel like we're too good to do it, or even too busy, but it's because part of learning how to be a programmer is learning how to analyze the problem, design a solution, and finally, implement that solution. You're not learning ANYTHING by...
12 Jan 2011 by #realJSOP
Let me ask this: If other parts of your app use MFC, what's the point in removing the parts that you did. You haven't accomplished your goal of removing the MFC dependancies from your app, so why not just put them back in and call it a day?EDIT (for your 1st comment) =========My advise...
20 Jan 2011 by #realJSOP
Why don't you just add the new tab page to the existing form? I see no need for a design change given the description you've provided so far.
21 Jan 2011 by #realJSOP
Have the tab control that contains the tab pages hook into the events generated by the buttons, and when ne of them fires, simply activate the associated tab page.
24 Feb 2011 by #realJSOP
I think this is how you'd do it.public partial class CSingletonForm : Form{ public: static CSingletonForm& Instance() { static CSingletonForm singleton; return singleton; } // Other non-static member functions private:...
1 Mar 2011 by #realJSOP
You have to use Invoke. Google is your friend: Search results for "C# ui update from thread"[^]
16 Mar 2011 by #realJSOP
Try putting this in your Main method:Application.EnableVisualStyles();Application.SetCompatibleTextRenderingDefault(false);Application.Run(new MyDomForm());
23 Mar 2011 by #realJSOP
Yes, but you're wasting your time. Windows/.Net assigns core affinity for threads and processes automagically.EDIT ========1-voting this isn't going to change the truth of what I say.
14 Apr 2011 by #realJSOP
You can't use MFC controls directly in a managed application (indicated by your tag). Here's the MSDN explanation of the class:http://msdn.microsoft.com/en-us/library/bb983509.aspx[^]Further research can be readily conducted using google.
23 May 2011 by #realJSOP
Why don't you just put your code into a try/catch block and handle the exception properly?private: System::Void Button_Click(System::Object^ sender, System::EventArgs^ e){ try { LiveDocs doc(); doc.Show(LiveDocs::liveDocType::Manual); } catch...
3 Jun 2011 by #realJSOP
I wouldn't specialize if I were you. Just move to .Net and be done with it. At the very least, learn whatever you need to get your job done, and if you have time, investigate/learn stuff that looks interesting. If you have even a cursory understanding of how each .Net platform works, you can...
7 Mar 2012 by #realJSOP
Inheriting interfaces. You can inherit one class, and multiple interfaces. Alternatively, you can create an inheritance chain. I suppose you could also use dependency injection to get around it.When using MFC (unmanaged C++), you couldn't multiple inherit from anything derived from...
9 Mar 2012 by #realJSOP
If you want to share data between forms, your best bet is to make put data into static class that both forms can access. (You're going to have to convert the code below to C++.)public static class Globals{ public static string MyString { get; set; }}
8 Mar 2009 by Đonny
This article introduces and describes a framework that allows the creation of managed plug-ins for the Total Commander file manager.
24 Oct 2010 by 002comp
Hello FriendsI am Creating an application using vc6 and In that m displaying a bmp with the help of BitBlt andCClientDC.Now,On some button click I want to Hide it.And m displaying this bmp on OnPaint().Is there any way to deselect the bmp to hide it?RegardsYogesh
15 Nov 2010 by 10Tec, Sergey Gorbenko
Tool for creating MS Visual Studio documentation files - XML Summaries, HxS/MSHC help solutions and manuals.
30 May 2013 by 123ezone
I have built a windows form application in C++ and I created a class with methods. But when accessing those methods it doesn't work.I have included header files as well as those methods are public. Please help me with this problem.Here is the method.int...
18 Apr 2012 by 7503
To create a service proxy, you can either run the svcutil.exe or simply add a Service Reference from your client application.Once you added the service reference, you can then instantiate the service object such as, HelloServiceClient svc = new HelloServiceClient();.
23 Mar 2013 by 8MX
Quick and easy way to use the Intel C++ compiler with C++/CLI.
20 Apr 2010 by @Intersect☺™
See this below link, this will assists you surely to serve your purpose Single Server With Multiple Clients : a Simple C++ Implementation[^]
3 Apr 2009 by _8086
union u{ char ch[2]; int i;};int main(){ union u x={0,2}; cout
27 Nov 2012 by __John_
Try here...http://blogs.msdn.com/b/jonathanswift/archive/2006/10/02/780637.aspx[^]
14 Aug 2013 by _Asif_
Check these linkshttp://social.msdn.microsoft.com/Forums/en-US/9282a43f-ee90-4375-8ad1-0f3841194b68/best-c-book[^]http://www.dreamincode.net/forums/topic/206400-good-c%23-tutorial/[^]
18 Feb 2014 by _Damian S_
Problems with the codeproject site itself are best reported here: http://www.codeproject.com/Forums/1645/Site-Bugs-Suggestions.aspx[^]
11 Apr 2013 by Aarón C de C
Use endless loops.while(true){//Your drawing code}Orfor(;;){//Your drawing code}You should probably make a Windows Form control for this, and run the endless loop in a separate thread.
18 Feb 2011 by ab4rum
Hi Everybody,Can anybody pls help me for my problem.I m facing a Mixed DLL Loading problem. My Parent program has successfully been converted from VC 6.0 to VS 2008, /clr (Mixed mode). However, facing problem for my security DLL project, which was VC 6.0 MFC Extension DLL. Login ID &...
30 Apr 2006 by abcdefrgtt
A class for manipulating dynamic matrices.
4 Jan 2013 by Abdelrahman Elzedy
//scientific calculator in c++//written by Abd - elrahman Elmasry//e-mail: abdoasemelzedy@hotmail.com//there is no copy right for this code#include//main library#include// for mathimatics function#include//for exeption conditionsusing namespace...
8 Nov 2014 by abdurahman ibn hattab
Your line:int* _pointer = (int*)DataArray[0];But you should use this instead:int* _pointer = (int*)&DataArray[0];
14 Dec 2011 by abhay bansal
I have some c++ .lib files(unmanaged) and I want to create a WCF service in which all the functions written in lib files can be called and finally can be used in distributed system (web, android, iphone).Doubts:Do I need a DCOM object to communicate cpp lib to c# and then DCOM dll is...
14 Dec 2011 by abhay bansal
Thanks Richard for the links. But I can't use DLLImport function as I have cpp classes and want to pass objects in my functions.Therefore, Extern "c" cant be used.
17 Aug 2010 by Abhi Lahare
Please take a look at this article.HTHAn OwnerDraw ComboBox with CheckBoxes in the Drop-Down[^]
19 May 2008 by Abhi_Coder
Implementation of Shared Pointer
24 Sep 2010 by Abhinav S
Some discussions here[^].
8 Nov 2010 by Abhinav S
Have a look at the posting / updating guidelines here[^]. The process for deleting an article is similar to updating one.
5 Apr 2011 by Abhinav S
Links to some articles http://www.codeproject.com/kb/audio-video/.
18 May 2012 by Abhinav S
Your question tag says C++/CLI. This is an ASP.Net question so you will most likely get fewer answers with an incorrect tag.Sessions, start withhttp://msdn.microsoft.com/en-us/library/ms972429.aspx[^]ASP.NET Session Management Internals[^]
12 Feb 2013 by Abhinav S
What you normally do is overlay text on a video - you don't need to add a label.There are some filters that would allow you to do this for e.g. Pure .NET DirectShow Filters in C#[^] describes a filter that adds text to a video.
11 Nov 2013 by Abhinav S
It requires a lot of work. If you have no programming experience, you might just want to learn programming first.If you have some experience, use that particular language and try building a website for starters.
28 Feb 2014 by Abhinav S
At textbox level, simply set the textbox property "ShortcutsEnabled" to false and you got it.Handle the right click on form and disable right click for e.g.private void form_MouseClick(object sender, MouseEventArgs e){ if (e.Button == System.Windows.Forms.MouseButtons.Right) ...
14 Sep 2014 by Abhinav S
TryAdding Icons to the System Tray[^]http://www.gamedev.net/topic/601819-csetting-icon-for-an-exe/[^]
17 Jun 2015 by Abhinav S
Conceptually, a dictionary does not have a beginning and an end - just a key and value.Adding a new key and value will add at the last location.
4 Apr 2017 by Abhineet Ayan Verma
Major calling conventions for Win32 and best suited functions
30 Dec 2012 by Abhishek Pant
this might help you:SMTP server settings on local machine to use automatic email service in ASP.Net using C#[^]SMTP Mail Delivery[^]Sending the contents of a webpage with images as an HTML mail[^]
11 Jul 2007 by abn9c
An article describing how to compile Matlab 7.1-7.4 mexw32 files using Visual Studio 2005
19 Jan 2015 by ac_code
Hello,I can't understand why the try-catch block in one dialog box are not caught exceptions (in project VS2005 C++ WinForms .NET 2.0)There is one form. Second form called from it by button. Call the ShowDialog method is framed by try-catch (Exception^ ex)When you press button in the...
23 Mar 2009 by Achilleas Margaritis
Dynamic message passing for C++.
12 Nov 2001 by Adalsteinn B. Bjarnason
Unique alarm application that works.
30 Jun 2009 by Adam Roderick J
A simple approach to Hook LoadLibrary API with a sample
18 Nov 2010 by AddictedHosting
Hi,I don't know that much about code and thing I am looking for is some help on getting some things made.wot i want is a app to have a text box that can have a name put in and bottons under the text box when you click one of them which say is named kick it will take the text from the box...
18 Nov 2010 by AddictedHosting
Hi it is a tool for a program i go on it just so we can op the room which something that works like this has a user name box and bottons under that which say kick ban and and some more that can be put in. when you hit the kick botton it will send to a windows /kick ady or /ban ady...
24 Dec 2009 by Adnan Merter
hii create a program a couple years ago in order to control step motor via parallel port by using VC++2005 and XP, it worked finebut now i am writing the same codes and linking the same library (inpout32.lib) in VC++ 2008 and windows 7, it also works and no error acoours, but i cannot...
17 Mar 2012 by Adnan Merter
hi,i am just beginning a new project which requires PC to Microcontroller board via rs232.everyting is fine but i dont know how to send Non-graphic ASCII characters.i mean SOH ACK NAK ETX.... etc. i found some of the such as LF NULLdo i have to use ascii to number functions each...
1 Apr 2012 by Adnan Merter
hi all,i need to find out how i can declare a global object which can be accesible from all functions of the same application.i created a global serialport object :System::IO::Ports::SerialPort^ serialPort = gcnew SerialPort(L"COM4" , 300, Parity::Even , 7, StopBits::One);then,...
27 Nov 2002 by Adrian-Bogdan Andreias
A smart logger that makes use of the new predefined VC++.NET macros.
6 Nov 2012 by Adriana Frunza
Hello everybody,I have from my console Qt application a .bat file which calls a Windows PowerShell script file. But th exit code is always 1 instead of 0.Here is the code:Console App: QFileInfo fileInf("listFiles.bat"); QStringList arguments; arguments
26 Oct 2012 by adriancs
[Edit]Marcus's Answer would be better.[/Edit]This can be done by passing the button control from Form1 into Form2.Example:private void button1_Click(object sender, EventArgs e){ button1.Visible = false; // pass in the button into Form2 Form2 f = new Form2(ref...
12 Sep 2010 by adzhou
I have a native C/C++ structtypedef struct { ... } AStruct; and in C++/CLI code i define one delegate and one cli array as followingpublic delegate void UpdateDataDelegate(AStruct% aSt,AStruct% bSt); cli::Array^ args=gcnew cli::Array(2); // complile failed!!!!。...
27 May 2010 by Aescleal
If you're programming in C, then:strncpy( q, p, 499 );q[499] = '\0';will do the trick and work however long the string is. If you'd like to obfuscate things a bit more then you can combine the two lines into one by exploiting the return value of strncpy:strncpy( q, p, 499 )[ 499 ]...
9 Aug 2010 by Aescleal
Try hoisting everything you can out of the if statements - first off the assignment to y is the same whatever values you're using:for (int j=0; j= 1 && j
4 Oct 2010 by Aescleal
Slightly off the wall answer here... Instead of learning C++ or C# why not try something a bit different? Python isn't a bad OO language and you can get things down fairly quickly in it. And it's got a C interface so you can plug stuff in written in C if you need extra performance.And if not...
16 Oct 2010 by Aescleal
If you're using C++ there's no reason to use printf or the whole god awful family of C relics. Use a stream. Then you get type safety and you won't try reading return addresses off the stack to interpret as strings. Consider rewriting along the lines of:int main(){ int d = 20; ...
30 May 2012 by Aescleal
The first thing you have to know is the protocol the server uses. If it's a common one like HTTP you can use an off the shelf library e.g. wininet[^] or libcurl[^] to do the business for you. If it's a proprietary protocol or one you specify then you're going to have to get a bit further...
29 Oct 2013 by Aescleal
Off the top of my head the best way of using a VS macro in C++ code would be to associate your VS macro with a C++ preprocessor define using the /D command line parameter (properties->C++->preprocessor->preprocessor definitions).Just make sure you have a decent default if someone doesn't set...
30 Oct 2013 by Aescleal
Try using std::map first. Yep, the performance is rubbish but often you can't tell the difference between optimal and rubbish when you've got a small number of things (less than thousands) to choose between. Another thing you might want to try is std::unordered_map as you can then write portable...
4 Mar 2010 by affricah741
ADVERT - deletedADVERT - deletedADVERT - deletedADVERT - deleted
16 Dec 2012 by Afrin Jaman
http://tinyurl.com/bu3cewt[^]Quote:http://tinyurl.com/bu3cewt[^]http://tinyurl.com/bu3cewt[^]Quote:http://tinyurl.com/bu3cewt[^]Quote:http://tinyurl.com/bu3cewt[^]Quote:http://tinyurl.com/bu3cewt[^]Quote:http://tinyurl.com/bu3cewt[^]Quote:http://tinyu...
21 Jul 2014 by Afzaal Ahmad Zeeshan
Since you're talking about ASP.NET you can have the SignalR service by ASP.NET. Which is dedicated for such realtime updates accross the network.All the users across the system would be able to chat and you can control the messages by showing them to only a number of users....
6 Nov 2014 by Afzaal Ahmad Zeeshan
Roslyn[^] is the .NET compiler. Read the MSDN source document for that. A normal compiler[^] is a compiler that is a template for every compiler because if you remove the normal (it is normal to remove normal). Rules of the normal compiler and its details can be found at the Wikipedia....
8 Nov 2014 by Afzaal Ahmad Zeeshan
This is a Fatal Error C1083[^]. Read that MSDN documentation to learn more about it. But the best remedy is to check for the fileName that you're including because this error generates when the compiler is not able to find a name by that name. Make sure that...
15 Aug 2015 by Afzaal Ahmad Zeeshan
Ah, same question from Quora, maybe same user from there too? :laugh:I answered this question on Quora in the following words: Afzaal Ahmad Zeeshan on Quora[^]:Qt... never will be used. But, as Qt claims it can create applications for every platform. You also are aware of Qt and can...
2 Jun 2009 by agetina
I can read the prototypes for windows.h in the include folder (I have installed dev c++) but i want a list of explained functions. I don't know for what to use each of them.Thank you! modified on Wednesday, June 3, 2009 4:29 AM
15 Nov 2022 by agoswami_84
Hi,could anyone provide me code source or mechanism for "let me google that for you". As i want to personalize the toolor if this is not the correct forum than if possible than please provide me correct forum
11 May 2010 by agoswami_84
my intension was to get info about some source code or mechanism which work like "le me google that for you" so that I can personalize Anyone have idea or info about thisI belive I did not ask any wrong question but place or forum may be worng but it is not that much wrong that I need...
11 May 2010 by agoswami_84
it does not give me much informationdoes anyone implement similiar kind of thing
14 Feb 2013 by Agustin Recoba
Hi again.. and sorry for bothering you... well, im working on a project... and I don't know if you know about a software called TempTracker, its free, and the thing that I want to do, its so save the coords... i mean, the software it's for the calibration of a pair of glasses, but when you hint...
10 May 2010 by ah123ah
Is there any way to use CRTDBG for detecting a memory leak in other applications?I mean, A is the program where CRTDBG code/APIs are written and B is the application in which I want to detect memory leak with the help of A.Can someone help me in this regard?
18 Aug 2010 by ahiggins1986
Hello,This problem seems so trivial, yet it is causing me a big headache. I have 4 checkboxes in my custom control, which I use to control which subsets to show on a graph. When any of these CheckBoxes' Checked property is changed, it fires an event handler.The problem is that the...
16 Aug 2009 by Ahmed Charfeddine
?Thanks. Easy Profiler : a compile-time profiler for C++www.potatosoftware.commodified on Sunday, August 16, 2009 5:41 PM
18 Feb 2007 by AhmedEssamNaiem
Using Vector and double linked list to create trees
18 Aug 2013 by Ahsan98
there are many good websites for that...some of the good websites aremsdn.microsoft.commybringback.comlynda.com(good but this is not free it needs money)and codeproject too.... :)also this is good ebook for learning c#...
31 Oct 2010 by aim999
Is it possible to make a VC++ WinForms gradient tab headers/pages like this one[^]?Thanks a lot^^Edit:When it comes to converting, I still have a problem:I checked the C# source after I downloaded it but couldn't find the gradient code.Well, I'm still a beginner :-O
6 Nov 2010 by aim999
Hello all.I have two list boxes. One of them is filled with file names and their directories.I want to count all duplicate file names in the first list box and put the file name and the number of duplication in the second list box.like: 0.TXT (6)the...
6 Nov 2010 by aim999
thanks a lot for the answer but I really couldn't understand many of it's expressions.I googled it but all I found was VB code.and about the idea you provided above, I tried it but it gives me an out of range exception.here is what I did so far:int L =...
7 Nov 2010 by aim999
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { for(int x=0; xItems->Add("D:\\QuakeII\\"+x+".TXT"); } for(int y=0; y
22 Nov 2010 by aim999
Hello everybody.I made a list box with the owner draw variable property enabled and handled both draw and measure item events to customize it.the problem is:I used a gradient brush for the selection but the color changes from the top of the list box to its bottom.:confused: I wish to...
22 Nov 2010 by aim999
I really should have concentrated.I changed [ClientRectangle] to [e->Bounds] and it went alright.but still don't know about Hot-tracking :(( could anybody give me logic or code. I found it's related to Mouse Enter, Move, and Leave events but couldn't understand the code. It wasn't in...
13 May 2008 by aisha.ansari
post office protocol to retrieve mails
31 Oct 2010 by Ajay Kashyap 87
Hi ,I am a student and have started working on a project.I am working on parallel streaming of video.If anyone has ideas or some useful links and information please post it or mail it to *Mail Removed*.
9 Jan 2010 by Ajay Vijayvargiya
Since Windows Vista supports "India' English", and has the following definition:0x4009 India (IN) 0x10 SUBLANG_ENGLISH_INDIA Visual Studio takes this as the project's language.While creating new project, one should select 'English (US)' as 'Resource Language' in Project Wizard.
16 Oct 2010 by Ajay Vijayvargiya
Perform Code Analysis with your code with /analyze switch with your Visual C++ compiler. You need to have Team System or the Ultimate version to do that.
16 Oct 2010 by Ajay Vijayvargiya
..//int g = 1;g++;....///This code not compiling? It can be because of only few reasons:g is #defined as a macro!g is actually declared to be constg is in a class, and the method is constAnd FYI, a .C file cannot be compiled with /clr.
17 Nov 2010 by Ajay Vijayvargiya
I faced the similar problem.The issue was with C++ DLL project which was on network.I just, after much of RnD, copied the DLL project into local machine, and it worked!
10 Sep 2008 by akiran
This article details how to create, install and use side-by-side native assemblies from C# and MC++.