summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/debugger/win/debugviewinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/modules/debugger/win/debugviewinfo.c')
-rw-r--r--src/osd/modules/debugger/win/debugviewinfo.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/osd/modules/debugger/win/debugviewinfo.c b/src/osd/modules/debugger/win/debugviewinfo.c
index f3c12a09f2e..55b806b0056 100644
--- a/src/osd/modules/debugger/win/debugviewinfo.c
+++ b/src/osd/modules/debugger/win/debugviewinfo.c
@@ -15,6 +15,8 @@
#include "strconv.h"
+#include "winutil.h"
+
// debugger view styles
#define DEBUG_VIEW_STYLE WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN
@@ -48,15 +50,15 @@ debugview_info::debugview_info(debugger_windows_interface &debugger, debugwin_in
// create the child view
m_wnd = CreateWindowEx(DEBUG_VIEW_STYLE_EX, TEXT("MAMEDebugView"), NULL, DEBUG_VIEW_STYLE,
- 0, 0, 100, 100, parent, NULL, GetModuleHandle(NULL), this);
+ 0, 0, 100, 100, parent, NULL, GetModuleHandleUni(), this);
if (m_wnd == NULL)
goto cleanup;
// create the scroll bars
m_hscroll = CreateWindowEx(HSCROLL_STYLE_EX, TEXT("SCROLLBAR"), NULL, HSCROLL_STYLE,
- 0, 0, 100, CW_USEDEFAULT, m_wnd, NULL, GetModuleHandle(NULL), this);
+ 0, 0, 100, CW_USEDEFAULT, m_wnd, NULL, GetModuleHandleUni(), this);
m_vscroll = CreateWindowEx(VSCROLL_STYLE_EX, TEXT("SCROLLBAR"), NULL, VSCROLL_STYLE,
- 0, 0, CW_USEDEFAULT, 100, m_wnd, NULL, GetModuleHandle(NULL), this);
+ 0, 0, CW_USEDEFAULT, 100, m_wnd, NULL, GetModuleHandleUni(), this);
if ((m_hscroll == NULL) || (m_vscroll == NULL))
goto cleanup;
@@ -68,9 +70,6 @@ debugview_info::debugview_info(debugger_windows_interface &debugger, debugwin_in
return;
cleanup:
- if (m_view != NULL)
- machine().debug_view().free_view(*m_view);
- m_view = NULL;
if (m_hscroll != NULL)
DestroyWindow(m_hscroll);
m_hscroll = NULL;
@@ -80,15 +79,18 @@ cleanup:
if (m_wnd != NULL)
DestroyWindow(m_wnd);
m_wnd = NULL;
+ if (m_view != NULL)
+ machine().debug_view().free_view(*m_view);
+ m_view = NULL;
}
debugview_info::~debugview_info()
{
- if (m_view)
- machine().debug_view().free_view(*m_view);
if (m_wnd != NULL)
DestroyWindow(m_wnd);
+ if (m_view)
+ machine().debug_view().free_view(*m_view);
}
@@ -254,7 +256,7 @@ HWND debugview_info::create_source_combobox(HWND parent, LONG_PTR userdata)
{
// create a combo box
HWND const result = CreateWindowEx(COMBO_BOX_STYLE_EX, TEXT("COMBOBOX"), NULL, COMBO_BOX_STYLE,
- 0, 0, 100, 1000, parent, NULL, GetModuleHandle(NULL), NULL);
+ 0, 0, 100, 1000, parent, NULL, GetModuleHandleUni(), NULL);
SetWindowLongPtr(result, GWLP_USERDATA, userdata);
SendMessage(result, WM_SETFONT, (WPARAM)metrics().debug_font(), (LPARAM)FALSE);
@@ -789,7 +791,7 @@ void debugview_info::register_window_class()
// initialize the description of the window class
wc.lpszClassName = TEXT("MAMEDebugView");
- wc.hInstance = GetModuleHandle(NULL);
+ wc.hInstance = GetModuleHandleUni();
wc.lpfnWndProc = &debugview_info::static_view_proc;
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hIcon = LoadIcon(wc.hInstance, MAKEINTRESOURCE(2));
@@ -799,6 +801,8 @@ void debugview_info::register_window_class()
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
+ UnregisterClass(wc.lpszClassName, wc.hInstance);
+
// register the class; fail if we can't
if (!RegisterClass(&wc))
fatalerror("Unable to register debug view class\n");