Click here to Skip to main content
15,881,709 members
Everything / Programming Languages / C++

C++

C++

Great Reads

by Dr. WPF
.NET 3.5 SP1 is here! It's time to break out your DirectX skills. This article provides the information necessary to get started using a new DirectX interop feature in WPF called D3DImage.
by Hatem Mostafa
Artificial Neural Network C++ class with two use cases: Counter and Handwritten Digits recognition
by Jeffrey Walton
Import and export Cryptographic Keys in PKCS#8 and X.509 formats, using Crypto++, C#, and Java.
by Hans Dietrich
XColorSpectrumCtrl displays a color spectrum that allows user selection, and provides APIs for color based on RGB and HSL color models.

Latest Articles

by Michael Chourdakis
An introduction to machine learning with working C++ code that trains a linear regression model.
by PJ Arends
Trace your function calls to the Output window.
by Ștefan-Mihai MOGA
Task Manager shows you the programs, processes, and services that are currently running on your computer. You can use Task Manager to monitor your computer’s performance or to close a program that is not responding.
by Mohammed Faci
How to leverage ChatGPT to Build an Automation Framework using the Page Object Model

All Articles

Sort by Updated

C++ 

20 Aug 2009 by "Fish" (David B. Trout)
A command-line tool to run multiple programs in parallel (i.e. concurrently, as a group).
19 Oct 2010 by "Fish" (David B. Trout)
Simple parsing of VS_VERSIONINFO version information strings displayed in an XP-style file-properties "Version" tab
14 Jan 2017 by #dev_Preet
Is there something like recordset with filter like property in c++ in Linux(Ubuntu) ? Or what else can be used in place of recordset in this case ?Does anyone know something for this?What I have tried:Till now I am fetching values from variables but due to large data to be used I...
16 Apr 2001 by #realJSOP
Technique for utilizing a CResizablePage in a CFormView-derived class
6 Jun 2001 by #realJSOP
Extension of Paolo Messina's CResizableDialog concept
14 Mar 2002 by #realJSOP
Parse strings with specified delimiter and specified quote character
7 May 2001 by #realJSOP
Track a mouse click, even in a scrolled view
12 Dec 2001 by #realJSOP
A small function to either accept or create a UUID* and return a CString
15 Apr 2008 by #realJSOP
Helps with copying a device independant bitmap to the clipboard.
8 Dec 2002 by #realJSOP
Some dialogbox code to give the Blonde a clue
9 Dec 2002 by #realJSOP
One technique for performing a binary insertion sort on a std::list
22 Dec 2003 by #realJSOP
Add a scrollbar to a property page when the SIP is displayed.
13 May 2005 by #realJSOP
Create blinking cells for Chris Maunder's grid control.
9 Aug 2005 by #realJSOP
Enumerate all controls in a dialog box or form view.
28 Jul 2006 by #realJSOP
Copy a bitmap over a portion of another bitmap
3 Aug 2006 by #realJSOP
A passable workaround for the COleDateTime formatting behavior in MFC8.
17 Nov 2006 by #realJSOP
A technique for making stdio functions compile clean regardless of the Microsoft compiler used
29 Nov 2006 by #realJSOP
Here's some code that will automatically start your app on a secondary monitor if it's compiled with debug info.
30 Nov 2006 by #realJSOP
Two methods to retrieve the path/name of a VS2002 or higher DLL from within that DLL.
4 Dec 2006 by #realJSOP
Compare floating point numbers for equality at programmer-specified precision.
27 Jan 2007 by #realJSOP
Implement XML application profiles that are similar (but not too similar) to using INI files
15 Apr 2008 by #realJSOP
The right way to code using CodeProject for occasional support
15 Apr 2008 by #realJSOP
The right way to code using CodeProject for occasional support
27 Jan 2007 by #realJSOP
The right way to code using CodeProject for occasional support
15 Apr 2008 by #realJSOP
The right way to code using CodeProject for occasional support
12 Jan 2010 by #realJSOP
The right way to code using CodeProject for occasional support
26 Jan 2007 by #realJSOP
Add menu items to, and learn how to handle the system menu
12 Oct 2016 by #realJSOP
My views on how to be a proper programmer
8 Jan 2010 by #realJSOP
0) Learn to analyze code. That's what he's trying to teach you.1) Pretty much ANYBODY can write code (just look at all the VB code out there). It takes a real programmer to be able to read someone else' code and determine where they went wrong. This is a task you OFTEN have to perform in...
12 Jan 2010 by #realJSOP
You *could* create a dictionary collection of strings, and as you load them, put the resource ID and the string into this dictionary as you load them, and then write a method that would first check the dictionary (by key aka the resource ID, or by string) to see if the string is already...
12 Jan 2010 by #realJSOP
You would have to use SPY++ to find the window handle of the Opera address bar, and then somehow retrieve the text in that window using a windows message.
13 Jan 2010 by #realJSOP
Become familiar with the game and then write code to duplicate its behavior. Chances are that you won't be able to get the source to most games, regardless of their current status.
13 Jan 2010 by #realJSOP
Maybe you have to have the GroupBox reflect the OnDrag message to its children.
17 Jan 2010 by #realJSOP
Don't use MS Shell Dlg for your font. Select a specific font (and I recommend selecting one that comes with a standard Windows install). I use Arial (I like it better than MS San Serif).EDIT =============I don't understand why this was voted a 3. You may not LIKE the answer, but it's...
19 Jan 2010 by #realJSOP
Philosophical opinions aside, there are no advantages to a given programming language. Each one is useful and can be "the best choice" for a given task. Only the programmer can determine a given language's fitness for a particular task, and even that decision is based on his own level of...
21 Jan 2010 by #realJSOP
Once you do math, the results will be inconsistent. There's an article about it here on Codeproject.Reliable Floating Point Equality Comparison[^]If the language you're using has a decimal type, use it instead of floats/doubles, because using a decimal type for math that could result in...
29 Jan 2010 by #realJSOP
Fer christ's sake, use google! This is for QUICK answers.
29 Jan 2010 by #realJSOP
It might be, but I bet that you'd probably have to write a driver to do it.You need a lot of programmer foo to write drivers.
30 Jan 2010 by #realJSOP
The proper way to do it is to enumerate the child controls of the dialog box, find the highest tab order, and set the new button's tab order to the highest tab order you found + 1.However, your problem is that of visibility. Hide the button you don't want to be active, and Show the button...
1 Feb 2010 by #realJSOP
You could add namespaces to avoid the function name collisions.Of course, If you KNOW there will collisions, why don't you name them something like "MATLAB_xxxx"? This way, the compiler will simply not link them if they're not used.You could also put the functions into a lib, and simply...
1 Feb 2010 by #realJSOP
Determine the number of monitors, their resolutions, and their positions relative to the main monitor. Then, move the origin of the d3d app window to the left-most possible position (if your secondary monitor is to the left of your main one, your origin will have a negative X value). You will...
2 Feb 2010 by #realJSOP
There's no earthly way you can determine why the connection dropped. You can only determine that it did in fact drop.
5 Feb 2010 by #realJSOP
I think you need to google "C++ thunking".BTW, a 16-bit DLL won't work on a 64-bit OS - at all. With the increasing prevalence of 64-bit os's, I advice that you try to find another solution.
8 Feb 2010 by #realJSOP
First, it looks like C++ to me. Second, learn how to use tags. Your code is supposed to be properly formatted when you post it here.
10 Feb 2010 by #realJSOP
Crap in one hand, and want in another, and tell us which one fills up faster...
19 Feb 2010 by #realJSOP
If you want to find out what will happen, your best bet is to run the code under the debugger.Beyond that, why are you destroying the timer and then recreating it again? That seems rather pointless to me. What you should be doing (barring the use of multi-threading) is turn the timer OFF...
20 Feb 2010 by #realJSOP
You could intercept the system message that indicates that the computer is going into Sleep mode.EDIT ====================Unless the laptop has drivers that provide an additional system message indicating that the lid has closed, you're screwed. Beyond that, not all laptops would...
20 Feb 2010 by #realJSOP
If it's truly an object and not just a GDI drawing, you could use the BringToFront() method on the object (if that's not the name of the method, I'm sure there's something applicable you can use).
5 Mar 2010 by #realJSOP
This is "Quick Answers", not "Do My Homework For Me".
5 Mar 2010 by #realJSOP
Ever heard of google? You can find all manner of homework answers there.
7 Mar 2010 by #realJSOP
You can use a (free) program called Depends to examine the exposed API of the dll you're trying to use. Use google to find the download.
8 Mar 2010 by #realJSOP
What is a "xynt" service? I've been writing code for 30 years, and I've never heard of that.
9 Mar 2010 by #realJSOP
Try ShellExceute (I forgot exactly how it's done in C++, but ShellExecute sounds like it should point you in the right direction).
14 Mar 2010 by #realJSOP
All you have to do is iterate through the array and create a string that appends one byte at a time formatted as a hex value.
15 Mar 2010 by #realJSOP
Each printer has a minimum margin setting. Maybe 10mm smaller than your printer's minumum.I googled "C# printing margins", and found this:http://msdn.microsoft.com/en-us/library/system.drawing.printing.margins.aspx[^]
4 Apr 2010 by #realJSOP
Isn't there documentation on the ffdshow web site?
8 Apr 2010 by #realJSOP
Your button has to be able to detect when the mouse is within it's rectangle. I think I remember it being call mouse capture or something like that. It's been more than three years since I did any C++/MFC.Once the button detects that the mouse has entered its rectangle, you can have the...
17 Apr 2010 by #realJSOP
XP probably doesn't contain the appropriate C runtime version.
18 Apr 2010 by #realJSOP
Well, your question sucks. What have you tried? What problem are you facing? Did you look on google for an answer? Did you know a program already exists that does that, and it's free?For what it's worth, we aren't here to just write code for people. We come here to help people write their...
18 Apr 2010 by #realJSOP
Check out rent-a-coder. They have people there that love working for almost nothing.
19 Apr 2010 by #realJSOP
ICDBurn won't burn to DVD on XP. You can only do that on Vista and later.
23 Apr 2010 by #realJSOP
You can write all the code you want, but the first time the user has a friend/relatvie come over to "fix" their machine, and if the "fix" involves reinstalling windows, all of your efforts will be for naught.Besides that, you probably cannot legally prevent the user from using their...
25 Apr 2010 by #realJSOP
And I really need a shower. What's your question?
25 Apr 2010 by #realJSOP
After you maximize the app, focus the main window.
26 Apr 2010 by #realJSOP
I don't see why not. At the very most, you'd have to set compatibility on the executables associated with the compiler, but I doubt you'd even have to do that.I didn't even know Borland was still making compilers...
26 Apr 2010 by #realJSOP
Are you looking for just one specific repeating value, or all values that repeat? Are you interested in counting the repetitions, or do you just want to know that a given value repeats?
26 Apr 2010 by #realJSOP
Well, what are you trying to accomplish? In the code you've posted, as long as pwnd isn't null, you should be good to go. What else are you concerned about?
29 Apr 2010 by #realJSOP
My experience is that users don't like it when controls (or menu items) appear and disappear while they're using the program. At the very most, they are just barely comfortable with items being disabled, but when things start disappearing/reappearing, they freak out. I'd rethink my interface if...
2 May 2010 by #realJSOP
First, I'm not personally a fan of changing the standard Windows interface components. The reason Windows was invented was to provide a common user interface for all applications, with all the same look/feel. This makes the user subconsciously familiar will all applications that run on Windows,...
3 May 2010 by #realJSOP
So accept the answer (there's a button there for it).
5 May 2010 by #realJSOP
Are there file attachment size limits on your email account?When you zip it, what size is it?After zipping it, have you tried unzipping it before sending it?
7 May 2010 by #realJSOP
Your question is much too broad to warrant a "quick answer".
10 May 2010 by #realJSOP
Something like this:using System.IO;string[] files = Directory.GetFiles(myPath, "*.txt", SearchOption.TopDirectoryOnly);foreach (string file in files){ File.Delete(file);}
13 May 2010 by #realJSOP
Because Intellisense is VC6 sometimes doesn't work. That's the best I can tell you.
15 May 2010 by #realJSOP
Wow - 25 hours later, and still no answer. Did you by any chance run it under the debugger?
18 May 2010 by #realJSOP
The very first thing you need to do is think of a really cool name. Something along the lines of "ICantGoogleSoHowDoYouExpectMeToBeAbleToReadAMap". No, wait... that's WAY too long. Maybe "ImACluelessRetardAndICantGetUp". Nah, I think that one is too long as well. How about...
20 May 2010 by #realJSOP
For cryin' pout loud, you gotta be a lot more specific. HOW do you want to plot it? What kind of data are we talking about? Find a free charting library and use the damn thing.
21 May 2010 by #realJSOP
Have you established that the device even has .Net on it?Oh yeah - smply saying "it didn't work" is completely useless when you're trying to get help from someone.
23 May 2010 by #realJSOP
Compression ratio is determined by the type of data being compressed and the compression scheme being used, not by the file type being compressed. A text file is historically more compressable than a binary file.I googled "c++ compression library" and got 291,000 hits. I'm sure you can find...
29 May 2010 by #realJSOP
In the IDE, click File | New | Project, and under Visual C++/MFC, select "MFC ActiveX Control"
29 May 2010 by #realJSOP
And how much are you willing to pay for the code?This is NOT a place to come for complete applications that fulfill your homework assignments. If you have a problem, ask about the problem, but don't come here expecting someone to write your code for you.
30 May 2010 by #realJSOP
Can't you just write a stored procedure that returns that value?After scanning down through subsequent questions, I found your other one, and someone gave you the answer:http://www.codeproject.com/Questions/83315/Cplusplus-and-MySQL-aborted-connects.aspx[^]
1 Jun 2010 by #realJSOP
You have to derive a new class from CListCtrl, and override the OnPaint() event, drawing the item the way you want to. Keep in mind that you have to handle ALL painting situations when you do this.
2 Jun 2010 by #realJSOP
First, you need a handle to the target application's main window. This is much easier to achieve if your application launches the target application interally (using the Process object). After you get the window handle, you can send the window any Windows message that you wish.BTW, if...
10 Jun 2010 by #realJSOP
Google this phrase, and sift through over 1.6 million hits (including at least one hit that references a thread here on CodeProject):"c++ icons in menu"I would derive a new class for CMenuItem, and handle the OnPaint method, but it's been three years since I've done any MFC, and they...
19 Jun 2010 by #realJSOP
Start a new MFC application in Visual Studio, and copy your code into it in the appropriate place(s).
19 Jun 2010 by #realJSOP
Here's what you do (this is a three-year old memory, so you may have to tweak it).0) Put a GroupBox control on your form.1) Put the radio buttons inside the groupbox.2) Set the tab order, starting with the radio buttons, and finishing with the groupnbox.3) Set the first radio...
20 Jun 2010 by #realJSOP
A fixed-size child form in a MDI application doesn't make any sense, especially when you consider the Tile/Cascade or minimize/normalize/maximize abilites of a MDI child form.You should be considering the use of a modeless dialog box instead. At that point, you can make the dialog box not...
20 Jun 2010 by #realJSOP
Just put a public method in the base class that returns the name of the object represented by the this pointer. It doesn't even have to be pure virtual.
20 Jun 2010 by #realJSOP
You asked this on a web site that specifically features THOUSANDS of basic sample projects?
20 Jun 2010 by #realJSOP
Actually, the way it should go is that you should create a wcf service, and then port your code to .net while at the same time adding it to the service.Since you're going from C++/MFC, the process is going to probably be completely manual, meaning there's no automatic conversion utility...
21 Jun 2010 by #realJSOP
Why don't you just start a new appropriate Visual Studio project, and move the code into it?
29 Jun 2010 by #realJSOP
This line is suspect:cin>.ans;
30 Jun 2010 by #realJSOP
Try compiling the application.
1 Jul 2010 by #realJSOP
We can't help you if you don't tell us WHERE the problem is happening along with WHAT the problem is. You've simply given us a block of code and expect us to be able/willing to work at trying to get it to run on our own machines.
1 Jul 2010 by #realJSOP
Quick Answers is for asking programming questions about code you're hacving a problem with, and is NOT a forum for diuscussion about projects you'd like to build. There's probably an appropriate forum on this site for this kind of thing, but Quick Answers is NOT it.
6 Jul 2010 by #realJSOP
Buy a memory leak finder tool. There are several available.
6 Jul 2010 by #realJSOP
You mean you want to run Flash on a mobile. Have you tried google? That's what we would have to do to give you an answer.
8 Jul 2010 by #realJSOP
double sample = 1.234double fractional = sample - Math.Floor(sample);