-// fdebug.cpp : Defines the entry point for the application.
-//
+/* fdebug.c : Defines the entry point for the application. */
+
+#include <tchar.h>
-#include <windows.h>
+#include <windef.h>
+#include <winbase.h>
+#include <wingdi.h>
+#include <winuser.h>
#include <commdlg.h>
#include <process.h>
-#include <stdio.h>
-#include <tchar.h>
#include "resource.h"
#include "rs232.h"
HANDLE hCaptureFile; // Handle to the capture file
DWORD dwThreadId = 0; // Thread id of RS232 communication thread
-// Foward declarations of functions included in this code module:
+// Forward declarations of functions included in this code module:
ATOM MyRegisterClass(HINSTANCE hInstance);
BOOL InitInstance(HINSTANCE, int);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
-LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM);
-LRESULT CALLBACK ConnectionDialogProc(HWND, UINT, WPARAM, LPARAM);
-LRESULT CALLBACK CaptureDialogProc(HWND, UINT, WPARAM, LPARAM);
+INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
+INT_PTR CALLBACK ConnectionDialogProc(HWND, UINT, WPARAM, LPARAM);
+INT_PTR CALLBACK CaptureDialogProc(HWND, UINT, WPARAM, LPARAM);
VOID EnableFileMenuItemByID(UINT Id, BOOL Enable);
VOID CheckLocalEchoMenuItem(BOOL Checked);
-VOID Rs232Thread(VOID* Parameter);
+VOID __cdecl Rs232Thread(VOID* Parameter);
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
// Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
{
- if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
+ if (!TranslateAccelerator(hMainWnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
- wcex.lpfnWndProc = (WNDPROC)WndProc;
+ wcex.lpfnWndProc = WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
switch (wmId)
{
case IDM_ABOUT:
- DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);
+ DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, About);
break;
case IDM_EXIT:
DestroyWindow(hWnd);
}
else
{
- if (DialogBox(hInst, (LPCTSTR)IDD_CONNECTION, hWnd, (DLGPROC)ConnectionDialogProc) == IDOK)
+ if (DialogBox(hInst, (LPCTSTR)IDD_CONNECTION, hWnd, ConnectionDialogProc) == IDOK)
{
bConnected = TRUE;
EnableFileMenuItemByID(IDM_FILE_DISCONNECT, TRUE);
}
break;
case IDM_FILE_STARTCAPTURE:
- if (DialogBox(hInst, (LPCTSTR)IDD_CAPTURE, hWnd, (DLGPROC)CaptureDialogProc) == IDOK)
+ if (DialogBox(hInst, (LPCTSTR)IDD_CAPTURE, hWnd, CaptureDialogProc) == IDOK)
{
bCapturing = TRUE;
EnableFileMenuItemByID(IDM_FILE_STOPCAPTURE, TRUE);
break;
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
+ (void)hdc; // FIXME
EndPaint(hWnd, &ps);
break;
case WM_SIZE:
return 0;
}
-LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
HWND hLicenseEditWnd;
TCHAR strLicense[0x1000];
return FALSE;
}
-LRESULT CALLBACK ConnectionDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK ConnectionDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
UNREFERENCED_PARAMETER(lParam);
return FALSE;
}
-LRESULT CALLBACK CaptureDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK CaptureDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
OPENFILENAME ofn;
CheckMenuItem(hFileMenu, IDM_FILE_LOCALECHO, MF_BYCOMMAND|(Checked ? MF_CHECKED : MF_UNCHECKED));
}
-VOID Rs232Thread(VOID* Parameter)
+VOID __cdecl Rs232Thread(VOID* Parameter)
{
BYTE Byte;
TCHAR String[MAX_PATH];