Do we still have a limit of 255 controls per dialog?
Hello. I was creating a C++ dialog in the resource editor (Visual Studio 2017). I got a warning that my dialog contains more than 255 controls. Do we still have this limitation in Visual Studio 2017? Thank you. Konstantin
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,…
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…
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; …
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.
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…
How to add function in C++, Visual Studio Community 2022
How to add function in C++, Visual Studio Community 2022. System: Windows 11 Home
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); …
"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++ 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…
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…
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,…
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…
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…
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…
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…
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.
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…
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…
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…