Click here to Skip to main content
15,888,461 members
Everything / Programming Languages / VC++

VC++

VisualC++

Great Reads

by Eugene Balabanov
A tiny sandbox primer
by jurhas
A small simulator for a 6 axis articulated robot
by Marius Bancila
Using managed COM objects in C++ without registering the server in Windows Registry
by Petrov Vladimir
Weiler-Atherton algorithm in MFC codes demo implementation

Latest Articles

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 Ștefan-Mihai MOGA
This article is about the IntelliFile application which is a free alternative Windows version to Total Commander and uses many components that have been published on CodeProject.
by Ștefan-Mihai MOGA
You can use IntelliPort to transfer large files from a computer onto your portable computer using a serial port rather than going through the process of setting up your portable computer on a network.
by Tough Developer
How to compile WinQEMU v0.10.2 in VS2008 and VS2012

All Articles

Sort by Updated

VC++ 

8 Apr 2024 by Vasily Androshchook
As the debugger showed a protected member of CFile::m_strFileName became empty for the closed file. So, derive your class from CFile and add a function bool MyFile::isClosed () const {return m_strFileName.IsEmpty ();}
8 Apr 2024 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.
30 Mar 2024 by Ștefan-Mihai MOGA
This article is about the IntelliFile application which is a free alternative Windows version to Total Commander and uses many components that have been published on CodeProject.
4 Mar 2024 by Richard MacCutchan
See your previous question on this same subject: No instance of overloaded function Microsoft::reporting::winforms::localreport::render[^].
4 Mar 2024 by Paramu1973
Hi, Iam using VS2015 Winforms, VC++. C++/CLI With my application I try to print the rdlc report. And I get the below error. can't take address of 'PrintRDLCReport::CreateStream' unless creating delegate instance. private: static Stream^...
3 Mar 2024 by Richard MacCutchan
According to LocalReport.Render Method (String, String, CreateStreamCallback, out Warning ) (Microsoft.Reporting.WinForms) | Microsoft Learn[^], warnings should be an array of Warning Class (Microsoft.Reporting.WinForms) | Microsoft Learn[^]...
3 Mar 2024 by Paramu1973
Hi, I have small application VS2015 Visual C++, WindowsForms. And I try to print the RDLC report directly to the printer. For that when I tried, I get struck, while I render the report. Any kind advices will be enable to complete the task. Thanks...
21 Feb 2024 by Ștefan-Mihai MOGA
You can use IntelliPort to transfer large files from a computer onto your portable computer using a serial port rather than going through the process of setting up your portable computer on a network.
28 Jan 2024 by CPallini
You know you may search articles, here at CodeProject. An example of a quick search[^]
28 Jan 2024 by DrMN
Is there a simple minimal example of a project in Visual C++ that graphs x-y data? This is to operate a small spectrometer. I would like a starting point that shows a graph and does little else, to which I can add controls, a thread that reads...
30 Oct 2023 by WilEpic
There is a function called FormatMessageV which is part of the CString class that is supposed to 'Format a message string using a variable argument list' according to MSDN. But other than the said operation, unfortunately it also replaces \n in...
30 Oct 2023 by Maxim Kartavenkov
The FormatMessageV used for the formatting error messages from the system or specified module. It is wrap around the FormatMessageW function (winbase.h) - Win32 apps | Microsoft Learn[^]. Adding CRLF standard behavior in that case. Maybe you just...
29 Oct 2023 by Pete O'Hanlon
As Richard said, this is normal Windows behaviour. If you want to remove the \r, then use the Replace command to convert the Windows line endings to Unix line endings:formattedText.Replace(_T("\r\n"), _T("\n"));
6 Aug 2023 by Marlon Rivera
Can someone help me with my problem? I am a beginner only in programming. I have 2 labels that count 1 every time I send a signal to my Arduino input. Last time If I close the program it reset to 0. I add the program that will save the count...
6 Aug 2023 by OriginalGriff
Each time you call UpdateSignalCountLabel it updates the labels with the values from your internal variables, and saves them to individual files. But unless you somewhere read those files and update the values of signalCountO and signalCount1...
27 Jul 2023 by chaiein
How to change the position and size of static element in dialog based Mfc?I have a CStatic box by drag and drop now I want to change the position and size of that element in the code. How can I do this?CStatic *pWnd= (CStatic *)GetDlgItem(IDC_STATIC_PICTURE); //Id of CStatic...
27 Jul 2023 by Member 16060076
CRect rc; CWnd *wnd = GetDlgItem(IDYES); wnd->GetWindowRect(&rc); ScreenToClient(rc); wnd->SetWindowPos(NULL, rc.left, rc.top+10, rc.Width(), rc.Height(), SWP_SHOWWINDOW);
10 Jul 2023 by Stan Huang
I've got a main program starting with: int main(int argc, char**argv) { ..... } It is compiled successfully, but when I built it, I got message as below. It means that my main program is an unresolved symbol to be referenced by exe_main() object. I got confused. 1>------ Rebuild All...
10 Jul 2023 by ISHANSH LAL
I recently encountered the same problem and i solved it by re-saving file in UTF-8 using notepad.
24 May 2023 by Member 8730814
I wrote a C program using VS code, and tried to assign a string to an array inside an If-statement of C language. But it doesn't work. However, only integer variables are successfully assigned. Why is that? Here is the code: #include ...
24 May 2023 by OriginalGriff
To add to what Richard has said, this code can never work: char NumberType[] = "POSITIVE"; ... NumberType[10] = "NEGATIVE"; because NumberType is an array of characters, and so is "NEGATIVE" (string literals are stored as an array...
24 May 2023 by Richard Deeming
Quote: NumberType[10] = "NEGATIVE"; That attempts to store an array of chars in element 10 of an eight-element array of char values. That's not going to work. c - Assigning strings to arrays of characters - Stack Overflow[^] Apparently, you...
4 Apr 2023 by Tough Developer
How to compile WinQEMU v0.10.2 in VS2008 and VS2012
10 Feb 2023 by Member 14594285
Hi, I have a software in c++ to print with zebra printer but I must change components of labels like barcode, name..I'm searching on google but I don't find...Is there somebody that used zebra printer? What I have tried: I tried to search on...
10 Feb 2023 by k5054
ZPL is pretty straight forward, and well documented. See the Programmer's manual: https://support.zebra.com/cpws/docs/zpl/zpl-zbi2-pm-en.pdf If you're new to ZPL, the manual starts off with some simple examples. If you have google-chrome...
10 Feb 2023 by Richard MacCutchan
Try asking the people who know: Software Support | Zebra[^].
3 Feb 2023 by Joan M
Hello all, Using Windows 11 x64, and I must maintain an old project. I can't open dialogs with that OCX control embedded, but the application compiles and links properly and I can even execute the built exe without issues. I have already copied...
3 Feb 2023 by Joan M
WOW! Visual Studio Feedback[^] It looks like that making VS a 64 bits native program killed the opportunity to have 32 bits libraries, ocx... inside the program. Given MSCHRT20.OCX is a Microsoft old chart thing, I think the best I can do is...
30 Nov 2022 by Richa Vats
An Exception of type System.Exception was thrown when I am trying to open an already created window form in designer mode. This problem is coming when I am trying to open any window form which I have already created, in designer mode. I don't know why this error is coming. I need to edit my...
30 Nov 2022 by timothy collins 2022
Go to project. Then properties and delete any duplicate references or those references with error they are usually marked with a red I notation delete them and reload your design sometimes you may need to reboot the system if it persists
28 Nov 2022 by Kai Schtrom
How to use DSE-Patcher to disable Driver Signature Enforcement
16 Nov 2022 by Svetoslav Chekanov
Fast implementation of 2:1 image shrink (full image or part of it)
29 Oct 2022 by Michael Haephrati
The progress bar snippet explained in this article, can be called or updated from different running programs.
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...
18 Sep 2022 by Mikhail Semenov
This article proposes a mapping algorithm, called Segmented Map, which is almost as fast as Flat Map is random access and enumeration of elements and close to std::map in insertion of elements.
14 Sep 2022 by Artem Chornyi
I need help with verbal discription This is my first assignment I have no idea how to do it https://i.stack.imgur.com/Wv6zu.png[^] What I have tried: I don't know how to do it myself and I have to do it by tomorrow
14 Sep 2022 by merano99
First of all, it makes sense to type the code or OCR it into text. The include file indicates that a non-standard or outdated compiler was used. The variable o is not used, which usually causes a warning. The condition (a>0 && a%2 == 0) plays a...
14 Sep 2022 by OriginalGriff
While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for...
15 Aug 2022 by n.deny
i am trying to read and Write the data from microcontroller to c++/cli application using protocol . Write data were successfully done but i am unable to received the data. What I have tried: private: System::Void...
15 Aug 2022 by Richard MacCutchan
Take a look at Serial Port I/O[^] which explains how best to use the serial ports.
24 Jun 2022 by Member 10629356
In a project derived from the DirectX12 template, I am trying to append text to a log file. If I try this, the error codes tell me I don't have file permission. It works fine with my game brought in from an older version of Visual Studio and...
24 Jun 2022 by Member 10629356
I think I've figured it out. The code example uses UWP, which insists that I should be using Windows::Storage::StorageFile and its methods. If I try to use fopen_s, it marks it as 'no permission', even if I wrap it up in a task.
11 Jun 2022 by Andrea Simonassi
The first and simplest of the multiplication algorithms, fast enough to multiply not too large numbers
25 May 2022 by MohammedZr
Hello, I made a code that saves files name as a string for all files that exist in the same directory and iterate to print every file, but I want the function to print the file name in the subdirectories also. What I have tried: Code:- static...
25 May 2022 by Greg Utas
If you can use C++17, you can do this in a platform-independent way using filesystem[^]. The function ListFiles in this .cpp[^] should give you an idea how to use it. It creates a list of the paths to all files in a specified directory but avoids...
18 May 2022 by haiderajmal
hello, coders, I am a flutter developer and I want to develop software for my client but I don't know which technology is best for petrol pump management software? kindly advice me thanks What I have tried: hello, coders, I am a flutter...
18 May 2022 by Richard MacCutchan
Almost any technology would be fine. But with such a vague question it is impossible to give a definitive answer. You need to work on the product design before you can really decide on which languages and frameworks would be the best choice.
10 Mar 2022 by Vishalport
I have been try many time to resolve this Error. but still I am not able to solve this problem. there is not problem form Linker. the problem come form Linker. I am not able to resolve the Error. Thank...
10 Mar 2022 by OriginalGriff
We cannot fix this for you: we do not have access to your code, and you need this to fix it. LNK2001 and LNK1120 are both concerned with undefined symbols: your code is referring to a symbol which can't be found in the object files or libraries...
10 Mar 2022 by Greg Utas
Without seeing your code, it's impossible to answer other than to say that you're using a symbol that's still undefined after all your code is linked. Linker tools error LNK1120 | Microsoft Docs[^] Linker Tools Error LNK2001 | Microsoft Docs[^]
27 Jan 2022 by Phoenix Liveon
The problem was I cannot properly separate the declaration & definition of a templated symbols such as classes, structs, functions, and many more. Before we could continue I have this quick statement on how I organized my work/project. We can...
27 Jan 2022 by Stefan_Lang
Quote: The problem was I cannot properly separate the declaration & definition of a templated symbols such as classes, structs, functions, and many more Short answer: you cannot! From the link I posted above (emphasis mine): Quote: However, when...
25 Jan 2022 by Stefan_Lang
I have read, but didn't understand a word of, your question. In the topic header you mention templates, so the only advice I can offer is check out this guide: https://itnext.io/c-20-modules-complete-guide-ae741ddbae3d[^] The section Quote:...
25 Jan 2022 by Stefan_Lang
Quote: How do we do it right 1. Post your actual question at the top, maybe even in the topic heading 2. Provide your goal and relevant detail information after that, in the body of your posting. Make sure to keep it reasonably short by...
8 Jan 2022 by Stefan_Lang
You are calling the display method on your Hotel object and that displays the Floors within that Hotel, but you never correctly initialized the Floor objects stored inside your Hotel object. Instead you created and initialized a separate Floor...
8 Jan 2022 by Sheeda Bro
I am storing Floor objects in Floor floor_arr[3] array. Then using this array to call Floor class display() function. The problem is available rooms are always 0 because of constructor. I guess the available rooms value is not being returned by...
8 Jan 2022 by KarstenK
You mismatching the objects. Writing "Clear code" with better names would help you to avoid such bugs. Change to: int main() { int floorInput, roomsInput; Hotel hotel; Floor floor; Use the debugger for further details.
29 Dec 2021 by Richard MacCutchan
int test_function(int stop) { while(stop == 0) { //run my code } } This code will continue to run until the end of time as there is nothing in the code to cause it to stop. And that means that even pressing the stop button will have no...
28 Dec 2021 by WantToLearn1
Im total beginner and I know I can't get proper answer from most forums. I hope this forum is friendly for noobies, because I swear I have been looking tutorials to solve this problem, but without luck. I have created a gui form with Visual...
17 Dec 2021 by Member 15265176
I am using PRINTDLG library for an old windows application, that has to print some files. I configured it in a way that it pick up the default printer and print the document without showing any dialog box. But the problem is when there is no...
17 Dec 2021 by Rick York
The standard system dialogs allow one to use hook procedures so it would seem like you could utilize a hook procedure and potentially adjust some items from the dialog ie., remove them from consideration. According to the docs : PRINTDLGA...
3 Dec 2021 by Member 15438861
I have a custom class inherited from CMenu for the owner draw. I have changed the background color of the pop up menu but i cant change the border color. Please help either to remove the border altogether or change border color. Refer to...
3 Dec 2021 by Rick York
This article might be helpful : Yet Another Fully Functional Ownerdraw Menu[^]
1 Nov 2021 by joyjhonson
Hello Programmers,I am converting my ascii C++ project to unicode.I am facing troubles with getline function.Have a look on the code pasted below.// Ascii code: string OutputString; ifstream IniFile ("D:\\FileName.INI"); while ( /*some condition*/...
1 Nov 2021 by Michael Haephrati
I stumbled upon this question while trying to understand why I get gibberish text when I convert PDF files into text, as part of this [^] project. This question is still relevant today, and there is no real answer. An ideal answer would be the...
7 Sep 2021 by Yousef1996
Hello I'm Working on a project to add employee information into a access database, the whole project was working good, then I just added more textboxes and when I try to Insert a new record into the database its not adding any record + I keep...
7 Sep 2021 by Richard Deeming
In addition to the SQL Injection[^] vulnerability in your code, your column name doesn't look like a valid SQL identifier. In general, SQL identifiers need to consist of unaccented "latin" letters (a-z), digits (0-9), and underscores (_). They...
7 Sep 2021 by Wendelius
At least one issue is that you concatenate text directly from the textbox to your SQL statement. This leaves you open to SQL injection and other, syntactical problems. See SQL injection - Wikipedia[^] So instead of the concatenation here Dim DA...
18 Jul 2021 by kayalasheshu
Are there any conversion tools available to convert C++ source code to C#? I am asking about free tools. I need to convert VC++ code into C#. Is this possible? If such tools available, please share the URL. Thanks in Advance sss What I have...
16 Jun 2021 by Member 15248812
Hi guys, my aim is to capture the screen of a windows form using c++/cli. Below is the code to capture the window, however, it is in C#. What changes do I have to make to the code for it to work in c++? Graphics myGraphics =...
16 Jun 2021 by OriginalGriff
You are treating the class name as a pointer by using the -> operator to dereference a static member method. Try this: Graphics^ memoryGraphics = Graphics::FromImage(memoryImage); If you had gone to the MS documentation and selected C++ as the...
22 Apr 2021 by Codeproject345
Each time I click on the one of the tested person name it shows 'Run-time error 13 type mismatch' This may be related to visual basic code. The application closes itself. I have to keep creating another new person to the list but then the same...
22 Apr 2021 by Dave Kreskowiak
What could be the problem? Poorly written, poorly tested software. that error message is typically thrown by Visual Basic code when trying to assign the wrong type of data to a variable that's expecting a different type of data. For example,...
22 Apr 2021 by OriginalGriff
You should talk to the people who created it - we don;t even know what make it is, much less which model - they should provide technical support and will know more about their product than we will.
8 Apr 2021 by serg06
Or for a more modern solution: CWnd* btn = &m_btn; btn->SendMessage( WM_COMMAND, MAKEWPARAM( btn->GetDlgCtrlID(), BN_CLICKED), (LPARAM)btn->GetSafeHwnd() );
8 Apr 2021 by agent_suwastica
How to trigger ON_BN_CLICKED event at runtime?For example, I want to trigger the click event of a Button in my first Dialog when I click a Button of my second Dialog.I am using Microsoft Visual C++ 6.0 MFC.Thanks in advance.
4 Apr 2021 by Shruti Velankar
#include struct date { int year; int month; int day; }; void readDate(struct date *); void readDate(struct date *dateptr) { printf("\n Enter a new date:\n"); printf("year:"); scanf("%d",&(*dateptr).year);...
4 Apr 2021 by Patrice T
Quote: I don't understand what should i do to solve this error.Please someone help me. The error message means that your code is not C anymore when compiler reached the position of error. Pay attention to semicolons, there are rules to where...
2 Apr 2021 by Avtem
A couple of fixes when your Visual Studio Intellisense becomes buggy
26 Mar 2021 by Jochen Arndt
Add drag & drop support with drag images and drop descriptions to your MFC applications
25 Mar 2021 by Aleh Baradzenka
In this article, you will learn about an adjustable control that has zooming and scrolling tabs, dragging with the mouse, custom drawing and much more.
25 Mar 2021 by Kim Drnec
I have thousands of lines of transcribed txt data that looks like this NOTE Confidence: 0.25722745 a786057b-398f-4c16-8408-17ef2d53e3b6 00:00:07.810 --> 00:00:08.520 Right? NOTE Confidence: 0.90559334 133f78b8-c7ea-47a7-b714-e09f5411f162...
25 Mar 2021 by Greg Utas
It looks like you have three types of "noise": - A string of hex digits and hyphens: hhhhhhhh-hhhh-hhhh-hhhhhhhhhhhh - Time intervals: nn.nn:nn.nnn --> nn.nn.nn.nnn - Automated voice recognition confidence levels: NOTE Confidence: 0.nnnnnnnn ...
25 Mar 2021 by RickZeeland
Maybe you can use this library: GitHub - antonmilev/CText: C++ advanced text processing library[^] You probably need to look at the RegEx routines, also see: best-regex-testing-tools[^]
16 Mar 2021 by Aleh Baradzenka
This control is another kind of tab. Tabs are displayed as horizontal stripes and can be collapsed into buttons. Each tab is assigned its own window, which is shown when you click on the tab.
16 Mar 2021 by Aleh Baradzenka
In this article, you will learn about a control that is necessary for the partition of the dialog, main or child window of your program by several parts.
21 Jan 2021 by Axel Patron
Hi, I'm doing a BubbleShot project and I hae to create a 15*18 table to sort my bubbles, I have to use pointers but I'm not goot to this, I try to initialise it but I have a buffer overflow that I can solve, here is my .h #pragma once class...
21 Jan 2021 by OriginalGriff
Look at your code: table = new int* [18]; for (int i = 0; i
9 Jan 2021 by merano99
Listing the Files in a Directory - Win32 apps | Microsoft Docs[^] You have to check the Attribute and append new directory name in ffd.cFileName to path and call FindFirst again. // A TCHAR based std::string typedef std::basic_string...
7 Jan 2021 by MohammedZr
hi, I found out some code or a way to accomplish my goal, I understand the code 100% but the first problem is when I run the code it throws an Error with the code (123) like:- FindFirstFile Failed(123) the second problem is I want to iterate...
7 Jan 2021 by MohammedZr
Hello, I'm trying to understand how can I make a function that gives me all the files name in a specific directory and iterate for each file to print a message, how can I accomplish this function what library in c ++ should I use? What I have...
6 Jan 2021 by CPallini
Some info here: Bartek's coding blog: How to Iterate Through Directories in C++[^].
1 Jan 2021 by MohammedZr
So I'm attempting to put in Ascii Art in a C++ program, and did but the problem is i'm getting other characters instead of the right one. what the console writes:- Screenshot Does this occur because the characters are not recognizable by the...
1 Jan 2021 by Stefan_Lang
In addition to what Rick said, the way 8 bit character are displayed depends on the way they are translated, and you can use different codepages as well as different conversion methods for that. I would try it with codecvt, even though it's...
31 Dec 2020 by Rick York
Almost - it's because the characters used in the font displayed on this web page are not necessarily the same ones used by the font used by that console. Try writing a program to loop through the characters from decimal values 32 to 254 and see...
19 Nov 2020 by Rick York
First, you don't need the function prototypes. As long as a function or its prototype appears before it is used you are OK. Second, you can lose the function OverTime entirely and for two reasons : it is not called and it does not do what its...
19 Nov 2020 by Japanese Relaxation
Create a simple programmer prototype Library using a .h header file for your GrossPay Function Prototypes. Write a .cpp file that includes your functions from your Gross Pay program but no prototypes. Create a program called OverTime that calls...
19 Nov 2020 by CPallini
Your code looks correct to me, albeit not fully compliant with the requirements (e.g. you didn't write the function prototypes in a separate header).
1 Nov 2020 by Rick York
A Handy Memory Allocation Tracking Macro and Header for Visual Studio C++ Code
22 Oct 2020 by Avtem
(My IDE is Visual Studio 2019) So, the question is about the macro UNICODE. Which works fine if there is only one source file in the project. However, if there are multiply source files, and UNICODE macro is defined only in one of them, linker...