From 15d3bcca5ca0cbc7ff50daa22d01989dcbc1453c Mon Sep 17 00:00:00 2001 From: freedom Date: Wed, 11 Oct 2023 10:49:34 -0600 Subject: [PATCH] it no longer crashes --- progmgr/dialog.c | 3 ++- progmgr/group.c | 4 ++-- progmgr/group.h | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/progmgr/dialog.c b/progmgr/dialog.c index e41d871..df9f38c 100644 --- a/progmgr/dialog.c +++ b/progmgr/dialog.c @@ -33,6 +33,7 @@ WCHAR szDlgTitle[64]; \* * * */ BOOL CALLBACK NewGroupDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARAM lParam) { + // TODO: warning C4047: 'initializing': 'WCHAR' differs in levels of indirection from 'void *' static GROUP grp = { .dwSignature = GRP_SIGNATURE, .wVersion = GRP_VERSION, @@ -66,7 +67,7 @@ BOOL CALLBACK NewGroupDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARAM grp.wChecksum = 0; grp.dwFlags = 0; grp.cItemArray = 0; - grp.pItemArray = NULL; + // grp.pItemArray = 0; TODO: idk make sure this ain't all screwed up // Set the window title LoadString(hAppInstance, IDS_DLT_GRP_NEW, szDlgTitle, ARRAYSIZE(szDlgTitle)); diff --git a/progmgr/group.c b/progmgr/group.c index 1dfbf34..5563c66 100644 --- a/progmgr/group.c +++ b/progmgr/group.c @@ -224,7 +224,7 @@ PITEM CreateItem(_In_ HWND hWndGroup, _In_ PITEM pi) } // add the item - pItem = pGroup->pItemArray + pGroup->cItemArray; + pItem = &pGroup->pItemArray + pGroup->cItemArray; *pItem = *pi; // increment the item counter @@ -281,7 +281,7 @@ GROUP SaveGroup(_In_ PGROUP pg) .dwSignature = GRP_SIGNATURE, .wVersion = GRP_VERSION, .wChecksum = 0, - .szName = TEXT(""), + .szName = (VOID *)TEXT(""), .dwFlags = 0, .ftLastWrite = 0, .cItemArray = 0, diff --git a/progmgr/group.h b/progmgr/group.h index 9aeba92..a734639 100644 --- a/progmgr/group.h +++ b/progmgr/group.h @@ -62,7 +62,7 @@ typedef struct _GROUP { INT iIconIndex; // Items WORD cItemArray; // Number of items in pItemArray - PITEM pItemArray; // Array of items + ITEM pItemArray; // Array of items } GROUP, * PGROUP; /* Global Variables */