示例#1
0
        private void btnMakePlaybill_Click(object sender, System.EventArgs e)
        {
            Boolean bRet = false;
            IntPtr  hObj = CP5200.CP5200_Playbill_Create(Convert.ToInt32(m_txtWidth.Text), Convert.ToInt32(m_txtHeight.Text), 0x77);

            if (hObj != IntPtr.Zero)
            {
                if (CP5200.CP5200_Playbill_AddFile(hObj, GetProgramFileName()) >= 0)
                {
                    if (CP5200.CP5200_Playbill_SaveToFile(hObj, GetPlaybillFileName()) == 0)
                    {
                        bRet = true;
                    }
                }
                CP5200.CP5200_Playbill_Destroy(hObj);
            }

            if (bRet)
            {
                MessageBox.Show("Successful");
            }
            else
            {
                MessageBox.Show("Fail");
            }
        }