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

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

?? adtrig.c

?? Advantech Driver Demo: Software Data Transfer
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
/*
 ***********************************************************************
 *  Program     : ADTRIG.C                                             *
 *  Description : Demo program for analog input software data transfer *
 *  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_AIConfig     ptAIConfig;     // structure for AIConfig table
static      PT_AIVoltageIn  ptAIVoltageIn;  // structure for AIVoltageIn 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
USHORT      gwGain = 0;                         // gain index
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 : Software Data Transfer" , /* 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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲高清免费视频| 色婷婷av一区二区三区之一色屋| 中文av一区特黄| 国产亚洲一区字幕| 日本怡春院一区二区| 欧美精品在欧美一区二区少妇 | 91成人免费在线| 99re热视频精品| 色综合婷婷久久| 99精品黄色片免费大全| 99久久er热在这里只有精品15 | 99vv1com这只有精品| 粉嫩av一区二区三区粉嫩| 丁香婷婷深情五月亚洲| 麻豆精品精品国产自在97香蕉| 五月婷婷综合激情| 日本亚洲最大的色成网站www| 蜜臀99久久精品久久久久久软件| 免费日本视频一区| 日韩欧美国产高清| 久久婷婷国产综合国色天香| 亚洲成av人影院在线观看网| 日韩激情视频在线观看| 国产精品亚洲а∨天堂免在线| 91色porny在线视频| 99麻豆久久久国产精品免费 | 高清不卡在线观看av| 99久久99久久精品国产片果冻| 5月丁香婷婷综合| 精品国内二区三区| 中文字幕欧美区| 一区二区三区四区精品在线视频 | 欧美乱熟臀69xxxxxx| 欧美一区二区在线看| 国产亚洲综合在线| 亚洲一区二区三区四区五区中文| 日本亚洲视频在线| 成人免费av在线| 3d动漫精品啪啪一区二区竹菊| 国产日韩精品一区二区三区| 亚洲国产精品久久久久婷婷884| 久久er精品视频| 日本丶国产丶欧美色综合| 欧美不卡123| 亚洲无线码一区二区三区| 国产一区二三区| 欧美日韩在线播放三区四区| 国产亚洲欧美日韩俺去了| 亚洲夂夂婷婷色拍ww47| 午夜婷婷国产麻豆精品| 欧美日韩久久一区二区| 国产欧美久久久精品影院| 天天综合网天天综合色| 91亚洲永久精品| 精品久久久久久亚洲综合网| 一区二区三区在线免费| 国产不卡视频在线播放| 日韩欧美一区二区久久婷婷| 亚洲欧美激情小说另类| 国产成人亚洲综合a∨猫咪| 91精品国产色综合久久不卡电影| 国产精品天美传媒| 国内精品国产成人国产三级粉色 | 亚洲1区2区3区4区| 91精品国产乱| 欧美大片在线观看| 色成年激情久久综合| 欧美精品在欧美一区二区少妇| 日本亚洲三级在线| 欧美高清激情brazzers| 国产一区美女在线| 亚洲国产欧美日韩另类综合| 国产日产欧美一区二区视频| 色婷婷综合久久久久中文| 午夜久久久久久| 在线观看区一区二| 亚洲欧美另类在线| 99热在这里有精品免费| 久久亚洲综合色一区二区三区| 亚洲一区二区美女| 在线观看视频一区| 亚洲一区二区三区不卡国产欧美| 色综合婷婷久久| 伊人开心综合网| 日本乱码高清不卡字幕| 亚洲欧美在线aaa| 一本在线高清不卡dvd| 亚洲欧美日韩国产手机在线| 一本到一区二区三区| 亚洲日本在线天堂| 欧美亚洲国产一区在线观看网站| 亚洲在线视频网站| 欧美日韩精品综合在线| 日韩成人午夜精品| 日韩欧美国产一区二区三区| 黄色日韩网站视频| 国产精品护士白丝一区av| 日本高清视频一区二区| 亚洲123区在线观看| 日韩欧美美女一区二区三区| 国产乱码精品一区二区三区av| 久久精品人人做人人综合| 97精品视频在线观看自产线路二| 亚洲一区二区中文在线| 日韩精品一区二区三区蜜臀 | 日韩一区二区三区视频| 黄网站免费久久| 中文字幕一区二区三| 欧美理论在线播放| 国产成人免费在线视频| 亚洲美腿欧美偷拍| 日韩午夜小视频| 99视频在线精品| 亚洲一区二区三区四区的| 狠狠色综合日日| 久久人人爽人人爽| 成人午夜精品在线| 欧美男同性恋视频网站| 国产精品久久久久久久久久免费看| 自拍偷在线精品自拍偷无码专区 | 精品处破学生在线二十三| 国产欧美一区二区精品性| 五月婷婷欧美视频| 久久久亚洲高清| 国产精品美女一区二区三区| 欧美日韩一区二区三区不卡| 极品尤物av久久免费看| 亚洲国产精品一区二区久久 | 亚洲乱码日产精品bd| 色综合久久88色综合天天6| 国内精品久久久久影院薰衣草 | 国产在线精品视频| 亚洲.国产.中文慕字在线| 欧美高清在线精品一区| 欧美岛国在线观看| 欧美日韩国产综合一区二区| 91丝袜国产在线播放| 国产精品系列在线播放| 久久99久久99| 日韩**一区毛片| 有码一区二区三区| 亚洲欧洲三级电影| 日本一区二区三区久久久久久久久不 | 国产精品美女久久久久久久| 日韩美一区二区三区| 欧美日韩一区二区三区四区| 91小视频在线免费看| 不卡的av电影在线观看| 高清不卡一区二区在线| 久久成人精品无人区| 日韩高清一级片| 天堂资源在线中文精品| 亚洲一区日韩精品中文字幕| 一区二区三区国产精华| 亚洲精品国产一区二区三区四区在线| 国产女主播视频一区二区| 国产午夜精品理论片a级大结局| 2欧美一区二区三区在线观看视频| 91精品国产丝袜白色高跟鞋| 337p亚洲精品色噜噜| 欧美一区二区国产| 欧美一区二区三区喷汁尤物| 日韩欧美在线一区二区三区| 欧美大片一区二区三区| 精品少妇一区二区三区免费观看| 日韩三级精品电影久久久 | 国产999精品久久| 丁香六月综合激情| 91日韩一区二区三区| 欧洲一区二区三区免费视频| 欧美日韩亚州综合| 欧美高清激情brazzers| 欧美刺激脚交jootjob| 久久久蜜桃精品| 亚洲天堂2014| 日韩电影在线看| 国内欧美视频一区二区 | 一区二区三区欧美视频| 午夜精品一区在线观看| 麻豆成人91精品二区三区| 国产精品69毛片高清亚洲| 不卡视频在线观看| 欧美无砖专区一中文字| 精品国产乱码久久久久久免费| 国产亚洲综合在线| 亚洲一区二区免费视频| 国内国产精品久久| 色呦呦网站一区| 精品久久久久99| 亚洲精品菠萝久久久久久久| 美国十次综合导航| av电影天堂一区二区在线观看| 欧美精选在线播放| 国产欧美日本一区视频| 午夜影院久久久| 成人sese在线| 欧美大片国产精品| 亚洲精品中文字幕在线观看| 黄色精品一二区| 欧美日韩视频在线一区二区|