#define FILE_DEFAULT_COLOR 2
-
+/*
+ * We should probably test the SDK version instead of the compiler version,
+ * but this should work for our purposes.
+ */
+#if (_MSC_VER <= 1200)
+static UINT CALLBACK open_file_hook_proc(HWND of_hwnd, UINT ui_msg, WPARAM w_param, LPARAM l_param);
+static UINT CALLBACK save_as_file_hook_proc(HWND of_hwnd, UINT ui_msg, WPARAM w_param, LPARAM l_param);
+static UINT CALLBACK merge_file_hook_proc(HWND mf_hwnd, UINT ui_msg, WPARAM w_param, LPARAM l_param);
+static UINT CALLBACK export_file_hook_proc(HWND of_hwnd, UINT ui_msg, WPARAM w_param, LPARAM l_param);
+static UINT CALLBACK export_raw_file_hook_proc(HWND of_hwnd, UINT ui_msg, WPARAM w_param, LPARAM l_param);
+#else
static UINT_PTR CALLBACK open_file_hook_proc(HWND of_hwnd, UINT ui_msg, WPARAM w_param, LPARAM l_param);
static UINT_PTR CALLBACK save_as_file_hook_proc(HWND of_hwnd, UINT ui_msg, WPARAM w_param, LPARAM l_param);
static UINT_PTR CALLBACK merge_file_hook_proc(HWND mf_hwnd, UINT ui_msg, WPARAM w_param, LPARAM l_param);
static UINT_PTR CALLBACK export_file_hook_proc(HWND of_hwnd, UINT ui_msg, WPARAM w_param, LPARAM l_param);
static UINT_PTR CALLBACK export_raw_file_hook_proc(HWND of_hwnd, UINT ui_msg, WPARAM w_param, LPARAM l_param);
+#endif /* (_MSC_VER <= 1200) */
+
static void range_update_dynamics(HWND sf_hwnd, packet_range_t *range);
static void range_handle_wm_initdialog(HWND dlg_hwnd, packet_range_t *range);
static void range_handle_wm_command(HWND dlg_hwnd, HWND ctrl, WPARAM w_param, packet_range_t *range);
ofn->lStructSize = ofnsize;
ofn->hwndOwner = h_wnd;
+#if (_MSC_VER <= 1200)
+ ofn->hInstance = (HINSTANCE) GetWindowLong(h_wnd, GWL_HINSTANCE);
+#else
ofn->hInstance = (HINSTANCE) GetWindowLongPtr(h_wnd, GWLP_HINSTANCE);
+#endif
ofn->lpstrFilter = build_file_type_list(FALSE /*!save*/, NULL);
ofn->lpstrCustomFilter = NULL;
ofn->nMaxCustFilter = 0;
ofn->lStructSize = ofnsize;
ofn->hwndOwner = h_wnd;
+#if (_MSC_VER <= 1200)
+ ofn->hInstance = (HINSTANCE) GetWindowLong(h_wnd, GWL_HINSTANCE);
+#else
ofn->hInstance = (HINSTANCE) GetWindowLongPtr(h_wnd, GWLP_HINSTANCE);
+#endif
ofn->lpstrFilter = build_file_type_list(TRUE /*save*/, &save_index);
ofn->lpstrCustomFilter = NULL;
ofn->nMaxCustFilter = 0;
ofn->lStructSize = ofnsize;
ofn->hwndOwner = h_wnd;
+#if (_MSC_VER <= 1200)
+ ofn->hInstance = (HINSTANCE) GetWindowLong(h_wnd, GWL_HINSTANCE);
+#else
ofn->hInstance = (HINSTANCE) GetWindowLongPtr(h_wnd, GWLP_HINSTANCE);
+#endif
ofn->lpstrFilter = build_file_type_list(FALSE /*!save*/, NULL);
ofn->lpstrCustomFilter = NULL;
ofn->nMaxCustFilter = 0;
ofn->lStructSize = ofnsize;
ofn->hwndOwner = h_wnd;
+#if (_MSC_VER <= 1200)
+ ofn->hInstance = (HINSTANCE) GetWindowLong(h_wnd, GWL_HINSTANCE);
+#else
ofn->hInstance = (HINSTANCE) GetWindowLongPtr(h_wnd, GWLP_HINSTANCE);
+#endif
ofn->lpstrFilter = FILE_TYPES_EXPORT;
ofn->lpstrCustomFilter = NULL;
ofn->nMaxCustFilter = 0;
ofn->lStructSize = ofnsize;
ofn->hwndOwner = h_wnd;
+#if (_MSC_VER <= 1200)
+ ofn->hInstance = (HINSTANCE) GetWindowLong(h_wnd, GWL_HINSTANCE);
+#else
ofn->hInstance = (HINSTANCE) GetWindowLongPtr(h_wnd, GWLP_HINSTANCE);
+#endif
ofn->lpstrFilter = FILE_TYPES_RAW;
ofn->lpstrCustomFilter = NULL;
ofn->nMaxCustFilter = 0;
ofn->lStructSize = ofnsize;
ofn->hwndOwner = h_wnd;
+#if (_MSC_VER <= 1200)
+ ofn->hInstance = (HINSTANCE) GetWindowLong(h_wnd, GWL_HINSTANCE);
+#else
ofn->hInstance = (HINSTANCE) GetWindowLongPtr(h_wnd, GWLP_HINSTANCE);
+#endif
ofn->lpstrFilter = FILE_TYPES_COLOR;
ofn->lpstrCustomFilter = NULL;
ofn->nMaxCustFilter = 0;
ofn->lStructSize = ofnsize;
ofn->hwndOwner = h_wnd;
+#if (_MSC_VER <= 1200)
+ ofn->hInstance = (HINSTANCE) GetWindowLong(h_wnd, GWL_HINSTANCE);
+#else
ofn->hInstance = (HINSTANCE) GetWindowLongPtr(h_wnd, GWLP_HINSTANCE);
+#endif
ofn->lpstrFilter = FILE_TYPES_COLOR;
ofn->lpstrCustomFilter = NULL;
ofn->nMaxCustFilter = 0;