Skip to content

Commit

Permalink
無題シーケンス番号の保存に失敗する不具合の暫定対策
Browse files Browse the repository at this point in the history
拡張領域の指定に「sizeof式」を使っていたために利用箇所を見落とした?
独自定数を切って見落としを防ぎ、必要な量の拡張領域を確保するよう修正。
  • Loading branch information
sanomari committed Jun 1, 2022
1 parent fd67590 commit ff8b018
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions sakura_core/env/CAppNodeManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,11 @@ BOOL CAppNodeGroupHandle::AddEditWndList( HWND hWnd )
}

/* ウィンドウ連番 */

if( 0 == ::GetWindowLongPtr( hWnd, sizeof(LONG_PTR) ) )
constexpr auto MY_GWLP_SEQUENCE = sizeof(LONG_PTR) * 1; // 2個目の拡張領域。
if( 0 == ::GetWindowLongPtr( hWnd, MY_GWLP_SEQUENCE ) )
{
pShare->m_sNodes.m_nSequences++;
::SetWindowLongPtr( hWnd, sizeof(LONG_PTR) , (LONG_PTR)pShare->m_sNodes.m_nSequences );
::SetWindowLongPtr( hWnd, MY_GWLP_SEQUENCE, (LONG_PTR)pShare->m_sNodes.m_nSequences );

//連番を更新する。
sMyEditNode.m_nIndex = pShare->m_sNodes.m_nSequences;
Expand Down
2 changes: 1 addition & 1 deletion sakura_core/window/CEditWnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ HWND CEditWnd::_CreateMainWindow(int nGroup, const STabGroupInfo& sTabGroupInfo)
wc.style = CS_DBLCLKS | CS_BYTEALIGNCLIENT | CS_BYTEALIGNWINDOW;
wc.lpfnWndProc = CEditWndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.cbWndExtra = sizeof(LONG_PTR) * 2; //拡張領域を2個確保。
wc.hInstance = G_AppInstance();
// Dec, 2, 2002 genta アイコン読み込み方法変更
wc.hIcon = GetAppIcon( G_AppInstance(), ICON_DEFAULT_APP, FN_APP_ICON, false );
Expand Down

0 comments on commit ff8b018

Please sign in to comment.