HOME FORUMS MEMBERS RECENT POSTS LOG IN  
× Авторизация
Имя пользователя:
Пароль:
Нет аккаунта? Регистрация
Баннер 1   Баннер 2
НОВЫЕ ТОРГОВАЯ НОВОСТИ ЧАТ
loading...
Скрыть
Вернуться   ANTICHAT > ПРОГРАММИРОВАНИЕ > С/С++, C#, Rust, Swift, Go, Java, Perl, Ruby
   
 
 
Опции темы Поиск в этой теме Опции просмотра

  #1  
Старый 03.10.2024, 07:51
Olympicus
Познающий
Регистрация: 02.03.2021
Сообщений: 93
С нами: 2738171

Репутация: 273
По умолчанию

Hi, I've been trying to make my life a little more miserable for a few days now and I'm trying to compile this C++ code. I should clarify that my knowledge of C++ is zero and even Visual Studio is unfamiliar to me (Yes, I'm a Notepad++ user). After following a few tutorials and YouTube videos, I was able to compile the code without errors, but when I run the updater, it throws up a "Failed to create window" message. Googling and checking the code, it looks like the window is never registered. After applying some changes suggested by ChatGPT, the updater runs without that error, but eventually gets stuck in an infinite loop, collapsed, and nothing happens.

C++:


Код:
WNDCLASSEXW wcex
;
wcex
.
cbSize
=
sizeof
(
WNDCLASSEX
)
;
wcex
.
style
=
CS_HREDRAW
|
CS_VREDRAW
;
wcex
.
lpfnWndProc
=
_WndProc
;
wcex
.
cbClsExtra
=
0
;
wcex
.
cbWndExtra
=
0
;
wcex
.
hInstance
=
hInstance
;
wcex
.
hCursor
=
LoadCursor
(
nullptr
,
IDC_ARROW
)
;
wcex
.
hbrBackground
=
(
HBRUSH
)
GetStockObject
(
BLACK_BRUSH
)
;
wcex
.
lpszMenuName
=
MAKEINTRESOURCEW
(
IDC_CPP_GAME_LAUNCHER
)
;
wcex
.
lpszClassName
=
Constants
::
GUID
.
c_str
(
)
;
RegisterClassExW
(
&
wcex
)
;
hWnd
=
CreateWindowExW
(
0
,
Constants
::
GUID
.
c_str
(
)
,
szWindowTitle
,
WS_POPUP
|
WS_MINIMIZEBOX
,
windowX
,
windowY
,
windowWidth
,
windowHeight
,
nullptr
,
nullptr
,
nullptr
,
nullptr
)
;
if
(
!
hWnd
)
throw
std
::
logic_error
(
"Failed to create window!"
)
;
Any recommendations or advice are welcome. I want to clarify that for the libraries I use vcpkg and Visual Studio 2022 (maybe this can cause some conflict (?))

GitHub - FLWL/CPPGameLauncher: A game launcher/updater/patcher written in C++ for the Windows platform.

A game launcher/updater/patcher written in C++ for the Windows platform. - FLWL/CPPGameLauncher

github.com
 
Ответить с цитированием
 





Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
 


Быстрый переход




ANTICHAT ™ © 2001- Antichat Kft.