3,472 questions with C++-related tags

Sort by: Updated
0 answers

WFP Define Filter Conditions

Can some on help me whit this. Well i try to Define Filter Conditions. Well, I'm not good to windows but i need to my goal is to access raw data from the network card.. IPv4 and IPv6 in socket IPv6 is restrict by windows so i can't work whit…

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,378 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,472 questions
asked 2024-03-18T22:20:58.6633333+00:00
Hello Junior 0 Reputation points
edited the question 2024-03-19T01:20:49.4133333+00:00
Minxin Yu 9,621 Reputation points Microsoft Vendor
3 answers

GetDateFormatEx returns a non-zero value but the buffer returned by it is faulty

This is the sample program in which "GetDateFormatEx" returns an invalid string. It is failing in customer's setup. #include <windows.h> #include <iostream> uint64_t shimTime(void) { FILETIME ts; …

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
11,863 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,472 questions
asked 2024-03-14T11:19:20.97+00:00
gupta, shivangi 0 Reputation points
edited a comment 2024-03-18T09:50:09.8733333+00:00
Viorel 110.3K Reputation points
2 answers

Count logical liines in a text control

Hi, ALL, There is a EM_GETLINECOUNT, but it will count the number of text lines. I'm looking for to count the displayed lines (or wrapped lines) in a text control. Either using WinAPI or C++. Thank you.

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,472 questions
asked 2024-03-12T05:03:09.4833333+00:00
Igor Korot 6 Reputation points
commented 2024-03-18T09:24:50.8933333+00:00
Hui Liu-MSFT 27,831 Reputation points Microsoft Vendor
0 answers

HeapReAlloc behavior for different heaps

The behavior below is tested in Visual Studio 2022. Calling HeapReAlloc on a private heap without changing the block size results in a no-op (as one would expect) HANDLE heap = HeapCreate(0, 0, 65536); void *p = HeapAlloc(heap, 0,…

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,378 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,472 questions
asked 2024-03-14T21:59:10.3233333+00:00
AndreyT 0 Reputation points
edited a comment 2024-03-18T07:32:58.4333333+00:00
Tong Xu - MSFT 521 Reputation points Microsoft Vendor
0 answers

Why do the Text Metrics change in Print Preview?

I am working on an old C++ WIN32 application using mfc in VS2022. The application generates a complex report that can be displayed or printed. In order to calculate where the page breaks will be in the printed version, the Draw() function is called from…

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,378 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,472 questions
asked 2024-03-12T14:18:15.74+00:00
RichardWhiteside-8349 6 Reputation points
commented 2024-03-18T06:27:09.65+00:00
Minxin Yu 9,621 Reputation points Microsoft Vendor
1 answer

How to add function in C++, Visual Studio Community 2022

How to add function in C++, Visual Studio Community 2022. System: Windows 11 Home

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,481 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,472 questions
asked 2024-03-17T08:57:13.01+00:00
Renjie Zhang 40 Reputation points
answered 2024-03-18T03:01:46.5866667+00:00
Minxin Yu 9,621 Reputation points Microsoft Vendor
1 answer One of the answers was accepted by the question author.

Doubts about the window of "program manager"

LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch(uMsg) { case WM_DESTROY: SetParent(hProgman, NULL); UpdateWindow(hProgman); UpdateWindow(hDefView); …

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,378 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,472 questions
asked 2023-10-09T14:53:11.8033333+00:00
Rer 80 Reputation points
commented 2024-03-15T04:04:56.83+00:00
Lee, Kang 0 Reputation points
0 answers

"Access is Denied." for gcc/g++ files when I am admin on my computer?

I am the only account and admin on my computer. I started coding in C++ for a class reccently and downloaded CLion as well as other C programmings files the class told us to use. When I run code in CLion the code always gives me the same error:…

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,472 questions
asked 2024-03-14T21:25:08.22+00:00
Jessica Barnes 0 Reputation points
edited a comment 2024-03-15T01:22:48.3266667+00:00
Minxin Yu 9,621 Reputation points Microsoft Vendor
1 answer

C++ screenshot using DXGI DuplicateOutput of screen is missing Game Bar drawn areas

It seems that the DXGI DuplicateOutput API fails to capture the Windows Game Bar drawn area. Similarly, none of the Game Bar widgets are included in captured screenshots. Why is this happening? Isn't DuplicateOutput supposed to cover all visible area on…

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,378 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,472 questions
asked 2024-03-12T21:10:55.57+00:00
Laszlo Oberlander 5 Reputation points
commented 2024-03-14T19:15:11.9833333+00:00
Laszlo Oberlander 5 Reputation points
1 answer One of the answers was accepted by the question author.

Alternatives for the application to make it as a packaged application?

Hi, I am currently building a WinUI3 C++ application using Windows App SDK. But currently the application is unpackaged mode. I am currently thinking to shift to packaged mode as it is recommended by the Microsoft currently I have tried the sample…

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
705 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,472 questions
asked 2024-03-13T04:17:56.3366667+00:00
Rohan Pande 210 Reputation points
commented 2024-03-14T06:00:42.71+00:00
Jeanine Zhang-MSFT 8,761 Reputation points Microsoft Vendor
1 answer

22H2 (10.0.22621) can't support TB_BUTTONCOUNT message of System Toolbar

before 22621 SV2, use MSDN message TB_BUTTONCOUNT can get system tray icon's count. But 22621 always get 0 and HWND is the same HWND m_HWND = ::FindWindow(_T("Shell_TrayWnd"), NULL); if (m_HWND != NULL) m_HWND = ::FindWindowEx(m_HWND, NULL,…

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,472 questions
asked 2023-08-02T11:30:58.7866667+00:00
Augustin Hung(洪紹翔) 0 Reputation points
commented 2024-03-13T17:38:40.2833333+00:00
Лесников Никита 0 Reputation points
2 answers

Initialize an Edit Control

Windows 11, VS 2022, C++, MFC What are the steps to set an initial value for Edit Control items? Hopefully, an image of the dialog will be shown somewhere in this question. I tried for the bottom after all the text. Now that its here I don't know how to…

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,472 questions
asked 2024-03-02T21:19:03.95+00:00
Bryan Kelly 316 Reputation points
commented 2024-03-13T08:54:58.7066667+00:00
RLWA32 39,236 Reputation points
1 answer

CPP First program: can't compile cout errors

Hi, I wrote this simple C++ program: #include <iostream> int main(){ cout<<"Hello World"<<std::endl; return 0; } It gives me following errors D:\CPP programs>gcc test2.cpp test2.cpp: In function 'int…

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,472 questions
asked 2024-03-12T22:10:11.16+00:00
Khan, Zulfi 0 Reputation points
answered 2024-03-12T23:19:53.25+00:00
Khan, Zulfi 0 Reputation points
1 answer

Why does my .NET8 web API app throw FileNotFoundException: Could not load file or assembly ***.dll when accessing C++/CLI dll in Docker?

I need to use the .NET CLI in my .NET C# web application. I created a basic app for troubleshooting https://github.com/v-klepko/Sandbox When I run it locally on my machine it works without issues. However, when I run the app in a Windows OS Docker…

.NET CLI
.NET CLI
A cross-platform toolchain for developing, building, running, and publishing .NET applications.
318 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,472 questions
asked 2024-01-20T21:05:21.19+00:00
Volodymyr Klepko 0 Reputation points
commented 2024-03-12T16:49:32.7933333+00:00
P, Rajasekar 0 Reputation points
1 answer One of the answers was accepted by the question author.

How to paste such function template body of code snippet in Visual Studio (C++) 2022?

I cannot figure out how to paste the code template at the point at time 10:49 or 12:05 at the learning video at https://www.youtube.com/watch?v=zv8DkkhBNR0 I browsed several similar learning videos about Visual Studio C++ 2022 and had the same…

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,472 questions
asked 2024-03-12T01:19:25.9966667+00:00
Stan Huang 20 Reputation points
commented 2024-03-12T05:40:25.9766667+00:00
Stan Huang 20 Reputation points
1 answer

Can't execute my first C++ program on VScode : gdb launch error

Hi, I am trying to run my first program on VScode. I am getting the gdb launch error (Select a debug configuration). This happens when I click the trainagle for running the C++ program. Somebody please guide me. I have added the image Zulfi.

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,472 questions
asked 2024-03-11T14:30:08.66+00:00
Khan, Zulfi 0 Reputation points
commented 2024-03-12T01:19:10.5266667+00:00
Minxin Yu 9,621 Reputation points Microsoft Vendor
2 answers One of the answers was accepted by the question author.

RichEdit's text not visible when window first pops up.

#include <Windows.h> #include <Richedit.h> HWND hwnd; HWND hwnd_richedit_panel; HWND richEdit; WNDPROC oldStaticProc; HWND hwnd_green_panel; WNDPROC oldGreenProc; int WINAPI WinMain(HINSTANCE, HINSTANCE, PSTR, int); LRESULT CALLBACK…

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,378 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,472 questions
asked 2024-03-11T04:37:56.38+00:00
Francesco Amatto 45 Reputation points
accepted 2024-03-11T17:46:06.32+00:00
Francesco Amatto 45 Reputation points
1 answer One of the answers was accepted by the question author.

How to draw a border and background color to the limits of a window?

#include <Windows.h> #include <Richedit.h> HWND hwnd; HWND panel; HWND richEdit; WNDPROC oldStaticProc; int WINAPI WinMain(HINSTANCE, HINSTANCE, PSTR, int); LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT msg, WPARAM wParam, LPARAM…

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,378 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,472 questions
asked 2024-03-11T00:17:38.78+00:00
Francesco Amatto 45 Reputation points
commented 2024-03-11T17:45:19.8866667+00:00
Francesco Amatto 45 Reputation points
2 answers One of the answers was accepted by the question author.

How do I prevent .dll preloading attacks when linking at load-time?

I'm trying to figure out how to securely link a dynamic-link library(.dll) at load-time. I want to make sure that the .dll I'm linking to is in fact the one I expect, and not a malicious one. I have read the Dynamic-link library security article, but…

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,472 questions
Windows 10 Security
Windows 10 Security
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Security: The precautions taken to guard against crime, attack, sabotage, espionage, or another threat.
2,719 questions
asked 2023-04-11T22:53:56.61+00:00
Aaron 51 Reputation points
commented 2024-03-11T12:25:16.8433333+00:00
Abdulrahman Mahmoud 0 Reputation points
0 answers

Why does it crash under release while not under debug when an exception occurs when mix use C and C++?

when I use ppl, there is a strange crash case. The pseudocode is as follows: //C++ function void funA() { //do_something(); funB(); //do_something(); if(error) throw exception(); } // C function!!! void funB() { //do_something(); parallel_for() { …

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,472 questions
asked 2024-03-06T11:11:16.0033333+00:00
Chao 0 Reputation points
commented 2024-03-11T02:49:11.8933333+00:00
Minxin Yu 9,621 Reputation points Microsoft Vendor