基恩士BT-W155G扫码枪PDA开发-扫描

第一个开发的项目,记录一下开发过程

一、去官网下载案例程序,在案例程序上做自己的功能

二、新建一个智能设备项目

 

三、调整窗口的大小,与PDA窗口大小一致

 

四、在之间下载的安装包内,找到DLL_4.430.zip,解压后,将dll文件引用到项目中,同时引用windowsce.forms

 

五、添加项目布局图及扫码按钮

 

 六、将基恩士案例程序中的代码copy过来,主要是将初始化、窗口读取、触发、数据读取相关的复制过来。

using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using Bt.ScanLib;
using Bt;

namespace BT_W155GProject2
{
    public partial class Form1 : Form
    {
        MsgWindow MsgWin;								// 消息窗口
        public static Form1 _MainForm1Instance;		    // 窗体
        public String AppPath = "";						// 应用执行路径

        //--------------------------------------------------------------
        // DLLImport
        //--------------------------------------------------------------
        [DllImport("coredll.dll", EntryPoint = "DeleteObject")]
        public static extern bool DeleteObject(IntPtr hObject);

        public Form1()
        {
            InitializeComponent();
            this.MsgWin = new MsgWindow();  // 生成消息窗口
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            // 画面尺寸调整
            if (System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width == 240)
            {
                resolution.ScreenSize.VGAtoQVGA(this);
            }

            //  不显示窗体的最大化,最小化按钮
            this.MaximizeBox = !this.MaximizeBox;
            this.MinimizeBox = !this.MinimizeBox;
            _MainForm1Instance = this;

            // 取得执行路径
            String path = this.GetType().Assembly.GetModules()[0].FullyQualifiedName;
            Int32 en = path.LastIndexOf("\\");
            AppPath = path.Substring(0, en);
        }

        /***********************************************************************
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

一(义)元之始

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值