亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? alarm.c

?? 16 relay output channels and 16 isolated digital input channels LED indicators to show activated
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
/*
 ***********************************************************************
 *  Program     : ALARM.C                                              *
 *  Description : Demo program for Win 16 with Alarm functions         *
 *  Revision    : 1.00                                                 *
 *  Date        : 9/5/1996                     Advantech Co., Ltd.     *
 ***********************************************************************
 *
 * FUNCTIONS:
 *
 *   InitApplication() - Initializes window data and registers window class
 *
 *   InitInstance() - Saves instance handle and creates main window
 *
 *   MainWndProc() - Process main window messages
 *
 *   ConfigDlgProc() - Process the dialog box messages for configuration
 */


#include <windows.h>
#include <stdlib.h>
#include <dos.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include "..\..\include\driver.h"
#include "..\..\include\os.h"
#include "resource.h"

// ------------------------------------------------------------------------
// CONSTANT DEFINITION
// ------------------------------------------------------------------------
#define     MAX_DEVICES     100


// ------------------------------------------------------------------------
// GLOBAL VARIABLES
// ------------------------------------------------------------------------
HANDLE      hInst;                      // current instance
HWND        hMainWnd;                   // main window handle


static      DEVFEATURES     DevFeatures;    // structure for device features
static      PT_AlarmConfig  ptAlarmConfig;  // structure for AlarmConfig table
static      PT_AlarmEnable  ptAlarmEnable;  // structure for AlarmEnable table
static      PT_AlarmCheck   ptAlarmCheck;   // structure for AlarmCheck table
static      PT_DeviceGetFeatures  ptDevFeatures;

char        szErrMsg[80];               // Use for MESSAGEBOX function
LRESULT     ErrCde;                     // Return error code

//
// used for dynamic allocation memory for the installed devices
//
// static  HGLOBAL     hDeviceList,hSubDeviceList;
// static  LPDEVLIST   DeviceList,SubDeviceList;
//

//
// used for fixed memory for the installed devices
//
DEVLIST     DeviceList[MAX_DEVICES];
DEVLIST     SubDeviceList[MAX_DEVICES];

LONG        DriverHandle = (LONG)NULL;          // driver handle
BOOL        bRun = FALSE;                       // flag for running
USHORT      gwDevice = 0, gwSubDevice = 0;      // device index
USHORT      gwChannel = 0;                      // input channel
FLOAT       gfLoLimit = 0.0f, gfHiLimit = 0.0f; // High and low limits
USHORT      gwLatchMode = 1;                    // momentary mode
USHORT      gwLoState = 0, gwHiState = 0;       // alarm status
SHORT       gnNumOfDevices, gnNumOfSubdevices;  // number of installed devices
USHORT      gwScanTime = 1000;                  // scan time
DWORD       gdwStartTime;                       // start time
DWORD       gdwElapseTime = 0;                  // elapse time
USHORT      gwOverrunCount = 0;                 // overrun count
FARPROC     lpfnConfigDlgProc;                  // config. dialog procedure
FARPROC     lpfnScanDlgProc;                    // scan dialog procedure


// ------------------------------------------------------------------------
// FUNCTION DECLARATION
// ------------------------------------------------------------------------
BOOL InitApplication(HANDLE);
BOOL InitInstance(HANDLE, int);
long FTYPE MainWndProc(HWND, UINT, WPARAM, LPARAM);
int  FTYPE WinMain(HANDLE, HANDLE, LPSTR, int);


/***************************************************************************
    FUNCTION: WinMain(HANDLE, HANDLE, LPSTR, int)

    PURPOSE: calls initialization function, processes message loop
****************************************************************************/

int FTYPE WinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow)
HANDLE hInstance;                          /* current instance             */
HANDLE hPrevInstance;                      /* previous instance            */
LPSTR lpCmdLine;                           /* command line                 */
int nCmdShow;                              /* show-window type (open/icon) */
{
    MSG msg;                               /* message                      */

    if (!hPrevInstance)                /* Other instances of app running?  */
      if (!InitApplication(hInstance)) /* Initialize shared things         */
          return (FALSE);              /* Exits if unable to initialize    */

    // Perform initializations that apply to a specific instance
    if (!InitInstance(hInstance, nCmdShow))
        return (FALSE);

    // Acquire and dispatch messages until a WM_QUIT message is received.
    while (GetMessage(&msg,      /* message structure                      */
        (HWND)NULL,              /* handle of window receiving the message */
        (UINT)NULL,              /* lowest message to examine              */
        (UINT)NULL))             /* highest message to examine             */
    {
        TranslateMessage(&msg);  /* Translates virtual key codes           */
        DispatchMessage(&msg);   /* Dispatches message to window           */
    }
    return (msg.wParam);         /* Returns the value from PostQuitMessage */
}

/****************************************************************************
    FUNCTION: InitApplication(HANDLE)

    PURPOSE: Initializes window data and registers window class
****************************************************************************/

BOOL InitApplication(hInstance)
HANDLE hInstance;                            /* current instance           */
{
    WNDCLASS  wc;

    // Fill in window class structure with parameters that describe the
    // main window.
    wc.style = CS_HREDRAW | CS_VREDRAW; /* Class style(s).                 */
    wc.lpfnWndProc = (WNDPROC)MainWndProc;  /* window process procedure    */
    wc.cbClsExtra = 0;                  /* No per-class extra data.        */
    wc.cbWndExtra = 0;                  /* No per-window extra data.       */
    wc.hInstance = hInstance;           /* Application that owns the class.*/
    wc.hIcon = LoadIcon(hInstance, "IDI_ICON1");
    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = GetStockObject(WHITE_BRUSH);
    wc.lpszMenuName =  "MyMenu";   /* Name of menu resource in .RC file.  */
    wc.lpszClassName = "MyClass";  /* Name used in call to CreateWindow. */

    // Register the window class and return success/failure code.
    return (RegisterClass(&wc));

}

/***************************************************************************
    FUNCTION:  InitInstance(HANDLE, int)

    PURPOSE:  Saves instance handle and creates main window
****************************************************************************/

BOOL InitInstance
(
    HANDLE          hInstance,          // Current instance identifier.
    int             nCmdShow            // Param for first ShowWindow() call.
)
{
    // Save the instance handle in static variable, which will be used in
    // many subsequence calls from this application to Windows.
    hInst = hInstance;

    // Create a main window for this application instance.
    hMainWnd = CreateWindow(
        "MyClass",                 /* See RegisterClass() call.           */
        "Advantech Driver Demo : Alarm" , /* Window title bar  */
        WS_OVERLAPPEDWINDOW,        /* Window style.                       */
        CW_USEDEFAULT,              /* Default horizontal position.        */
        CW_USEDEFAULT,              /* Default vertical position.          */
        CW_USEDEFAULT,              /* Default width.                      */
        CW_USEDEFAULT,              /* Default height.                     */
        NULL,                       /* Overlapped windows have no parent.  */
        NULL,                       /* Use the window class menu.          */
        hInstance,                  /* This instance owns this window.     */
        NULL                        /* Pointer not needed.                 */
        );

    // If window could not be created, return "failure"
    if (!hMainWnd)
        return (FALSE);

    // Make the window visible; update its client area; and return "success"

    ShowWindow(hMainWnd, nCmdShow);   // Show the window
    UpdateWindow(hMainWnd);           // Sends WM_PAINT message
    return (TRUE);                // Returns the value from PostQuitMessage
}

/***************************************************************************
    FUNCTION: ConfigDlgProc(HWND, unsigned, WPARAM, LPARAM)

    PURPOSE:  Processes dialog box messages for configuration
****************************************************************************/

BOOL FTYPE ConfigDlgProc
(
    HWND        hDlg,                          // window handle
    unsigned    message,                       // type of message
    WPARAM      wParam,                        // additional information
    LPARAM      lParam                         // additional information
)
{
    int         i;
    DWORD       dwIndex;
    char        szBuffer[40];
    int         nOutEntries;

    switch (message)
    {
    case WM_INITDIALOG :

        // --------------------------------
        // Initialize Device List Combobox
        // --------------------------------

        // get number of the installed devices

        if ((ErrCde = DRV_DeviceGetNumOfList((SHORT far *)&gnNumOfDevices)) !=
            SUCCESS)
        {
             DRV_GetErrorMessage(ErrCde,(LPSTR)szErrMsg);
             MessageBox(hMainWnd,(LPCSTR)szErrMsg, "Driver Message", MB_OK);
             return TRUE;
        }


        // ----------------------------------------------------------------
        // used for dynamic allocation memory for these installed devices
        //
        // if ((hDeviceList = GlobalAlloc(GHND, gnNumOfDevices *
        //      sizeof(DEVLIST))) == NULL)
        // {
        //    MessageBox(hMainWnd, (LPCSTR)"Not Enough Memory",
        //        "Memory Allocation", MB_OK);
        //    return TRUE;
        // }
        // DeviceList = (LPDEVLIST)GlobalLock(hDeviceList);
        // ----------------------------------------------------------------


        if (gnNumOfDevices > MAX_DEVICES)
            gnNumOfDevices = MAX_DEVICES;

        // retrieve the information of all installed devices

        if ((ErrCde = DRV_DeviceGetList((DEVLIST far *)&DeviceList[0],
            (SHORT)gnNumOfDevices, (SHORT far *)&nOutEntries)) != (LONG)SUCCESS)
        {
            DRV_GetErrorMessage(ErrCde,(LPSTR)szErrMsg);
            MessageBox(hMainWnd,(LPCSTR)szErrMsg,"Driver Message",MB_OK);
            return TRUE;
        }

        // initialize the Device List Combobox with the retrieved information

        for (i = 0; i < gnNumOfDevices; i ++)
            SendDlgItemMessage(hDlg, IDC_DEVICE, CB_ADDSTRING, 0,
                        (LPARAM)((LPSTR)DeviceList[i].szDeviceName));

        SendDlgItemMessage(hDlg, IDC_DEVICE, CB_SETCURSEL,(WPARAM)gwDevice,
                        (LPARAM)0);


        // -----------------------------------------------------------
        // Initialize Module List Combobox for COM port or CAN devices
        // -----------------------------------------------------------

        // check if there is any device attached on this COM port or CAN

        gnNumOfSubdevices = DeviceList[gwDevice].nNumOfSubdevices;
        if (gnNumOfSubdevices > MAX_DEVICES)
            gnNumOfSubdevices = MAX_DEVICES;


        // --------------------------------------------------------------
        // used for dynamic allocation memory for these installed devices
        //
        // if ((hSubDeviceList = GlobalAlloc(GHND, gnNumOfSubdevices *
        //    sizeof(DEVLIST))) == NULL)
        // {
        //    MessageBox(hMainWnd, (LPCSTR)"Not Enough Memory",
        //        "Memory Allocation", MB_OK);
        //    return TRUE;
        // }
        //
        // SubDeviceList = (LPDEVLIST)GlobalLock(hSubDeviceList);
        // --------------------------------------------------------------


        // retrieve the information of all installed devices
        if (gnNumOfSubdevices != 0)
        {
            if ((ErrCde = DRV_DeviceGetSubList(
                (DWORD)DeviceList[gwDevice].dwDeviceNum,
                (DEVLIST far *)&SubDeviceList[0],
                (SHORT)gnNumOfSubdevices,
                (SHORT far *)&nOutEntries)) != (LONG)SUCCESS)
            {
                DRV_GetErrorMessage(ErrCde,(LPSTR)szErrMsg);
                MessageBox(hMainWnd,(LPCSTR)szErrMsg,"Driver Message",MB_OK);
                return TRUE;
            }


            // initialize the Module List Combobox with the retrieved
            // information

            EnableWindow(GetDlgItem(hDlg, IDC_MODULE), TRUE);
            SendDlgItemMessage(hDlg, IDC_MODULE, CB_RESETCONTENT, 0,
                    (LPARAM)((LPSTR)0));

            for (i = 0; i < gnNumOfSubdevices; i++)
                SendDlgItemMessage(hDlg, IDC_MODULE, CB_ADDSTRING, 0,
                        (LPARAM)((LPSTR)SubDeviceList[i].szDeviceName));

            SendDlgItemMessage(hDlg, IDC_MODULE, CB_SETCURSEL,
					(WPARAM)gwSubDevice, (LPARAM)0);
        }
        else
        {
            EnableWindow(GetDlgItem(hDlg, IDC_MODULE), FALSE);
            SendDlgItemMessage(hDlg, IDC_MODULE, CB_RESETCONTENT, 0,
                    (LPARAM)((LPSTR)0));
        }


        // ------------------------------------------------------------
        // Initialize Channel Edit, it needs to get device
        // features for alarm channels
        // ------------------------------------------------------------

        // first : Open Device

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
97久久精品人人做人人爽| 久久精品999| 欧美日韩电影在线| 天堂精品中文字幕在线| 日本在线不卡视频一二三区| 91在线播放网址| 亚洲国产精品一区二区久久 | 日韩高清一级片| 日韩午夜在线观看视频| 国产综合色视频| 亚洲欧洲国产日韩| 欧美军同video69gay| 久久精品国产99国产| 国产精品国产三级国产专播品爱网 | 欧美高清hd18日本| 国产精品资源网| 亚洲欧美aⅴ...| 欧美成人video| 成人国产电影网| 日韩电影在线观看电影| 日本一区免费视频| 欧美性色综合网| 蜜臀精品久久久久久蜜臀| 亚洲欧美在线视频| 日韩欧美一区二区三区在线| 成人黄色a**站在线观看| 亚洲精品免费在线观看| 日韩一卡二卡三卡国产欧美| 国产乱子伦视频一区二区三区| 国产欧美日韩另类视频免费观看| 色婷婷综合久久久中文字幕| 久久69国产一区二区蜜臀 | 精品一区二区在线视频| 中文字幕国产一区二区| 日韩一级在线观看| 91黄色激情网站| 国产精品123| 日韩高清在线电影| 亚洲影院在线观看| 中文字幕免费一区| 久久只精品国产| 91网页版在线| 粉嫩高潮美女一区二区三区| 香蕉加勒比综合久久| 精品99久久久久久| 欧美日韩成人在线一区| 91在线一区二区| 国产成人鲁色资源国产91色综| 日本中文字幕一区| 香蕉久久夜色精品国产使用方法| 亚洲少妇中出一区| 中文字幕日韩一区| 国产欧美日韩另类视频免费观看| 日韩欧美国产精品一区| 欧美日本在线观看| 欧美日本国产视频| 欧美丝袜丝nylons| 欧美美女bb生活片| 91精品国产综合久久久久久| 欧美在线看片a免费观看| 日韩欧美在线网站| 911国产精品| 欧美一区二区三区公司| 777久久久精品| 欧美一区二区三区免费大片| 欧美一级高清片| 欧美xxxxxxxx| 美女国产一区二区三区| 国产精品成人一区二区三区夜夜夜| 国产调教视频一区| 国产精品伦理一区二区| 亚洲激情av在线| 亚洲va天堂va国产va久| 狂野欧美性猛交blacked| 韩国女主播一区| 国产成人小视频| 91丨九色丨蝌蚪富婆spa| 日本道免费精品一区二区三区| 欧美午夜理伦三级在线观看| 欧洲一区二区三区免费视频| 欧美精品tushy高清| 欧美一区二区三区视频免费播放| 欧美精品第一页| 久久久久国产精品麻豆ai换脸| 国产精品久久久久天堂| 亚洲欧美国产毛片在线| 日韩福利视频导航| av一区二区不卡| 91精品免费在线观看| 国产精品青草综合久久久久99| 有坂深雪av一区二区精品| 爽好久久久欧美精品| 成人一级视频在线观看| 91精品中文字幕一区二区三区 | 亚洲bt欧美bt精品777| 免费成人性网站| 99re热这里只有精品视频| 91精品国产一区二区三区 | 欧美日本不卡视频| 久久久精品综合| 蜜臀精品久久久久久蜜臀| 成人深夜在线观看| 欧美精品vⅰdeose4hd| 自拍偷拍亚洲激情| 国产精品一区二区x88av| 欧美精品18+| 亚洲最新在线观看| 99久久精品99国产精品| 久久久久久日产精品| 视频一区二区三区在线| 色天使色偷偷av一区二区| 国产精品久久三区| 国产成人av影院| 日韩亚洲欧美综合| 午夜精品成人在线| 欧美日韩在线三区| 亚洲18女电影在线观看| 97久久精品人人做人人爽| 国产精品国产三级国产三级人妇| 国产毛片精品国产一区二区三区| 亚洲伊人伊色伊影伊综合网| 国产精品一级片| 国产人久久人人人人爽| 岛国av在线一区| 国产精品三级久久久久三级| 国产一区中文字幕| 久久久久久久久久电影| 国产91清纯白嫩初高中在线观看| 久久精品人人做人人爽人人| 精品制服美女久久| 日本一区二区视频在线观看| 成人妖精视频yjsp地址| 亚洲青青青在线视频| 色偷偷久久人人79超碰人人澡| 亚洲老司机在线| 在线一区二区三区四区五区 | 一区二区免费在线| 欧洲精品视频在线观看| 图片区日韩欧美亚洲| 欧美成人性福生活免费看| 国产suv一区二区三区88区| 国产精品久久看| 91麻豆国产福利在线观看| 亚洲免费毛片网站| 91国偷自产一区二区三区观看| 亚洲欧美韩国综合色| 91在线播放网址| 91久久精品一区二区二区| 亚洲成人av电影在线| 久久综合久久综合亚洲| 色吧成人激情小说| 精品一区二区三区久久久| 中文av一区特黄| 91精品国产综合久久婷婷香蕉| 成人av资源网站| 亚洲国产另类精品专区| 中文字幕一区二区三区在线观看 | 国产精品素人视频| 精品久久久久一区| 欧美久久久一区| 色狠狠一区二区| 99久久综合精品| 国产精品1区2区| 国产一区亚洲一区| 国产一区二区三区久久久| 日韩影院精彩在线| 石原莉奈在线亚洲二区| 亚洲一区二区三区在线| 一区二区三区蜜桃网| 亚洲欧美一区二区在线观看| 国产精品免费人成网站| 国产农村妇女毛片精品久久麻豆| 精品福利二区三区| 日韩欧美色电影| 欧美成人a视频| 久久久国产精品午夜一区ai换脸| 日韩欧美国产精品一区| 欧美成人一级视频| 欧美大胆人体bbbb| 26uuu精品一区二区在线观看| 精品国产伦一区二区三区观看体验 | 亚洲国产精品久久久久婷婷884 | 精品欧美一区二区久久 | 97久久精品人人做人人爽 | 91麻豆精品国产91久久久资源速度 | 国产精品视频在线看| 亚洲啪啪综合av一区二区三区| **性色生活片久久毛片| 亚洲精品老司机| 香蕉成人伊视频在线观看| 蜜桃av一区二区三区| 成熟亚洲日本毛茸茸凸凹| 在线视频你懂得一区二区三区| 欧美性xxxxxx少妇| 久久久噜噜噜久久人人看| 亚洲免费在线观看| 国产一区二区三区四区在线观看| 成人性生交大片| 欧美久久婷婷综合色| 中文字幕的久久|