没有找到合适的产品?
联系客服协助选型:023-68661681
提供3000多款全球软件/控件产品
针对软件研发的各个阶段提供专业培训与技术咨询
根据客户需求提供定制化的软件开发服务
全球知名设计软件,显著提升设计质量
打造以经营为中心,实现生产过程透明化管理
帮助企业合理产能分配,提高资源利用率
快速打造数字化生产线,实现全流程追溯
生产过程精准追溯,满足企业合规要求
以六西格玛为理论基础,实现产品质量全数字化管理
通过大屏电子看板,实现车间透明化管理
对设备进行全生命周期管理,提高设备综合利用率
实现设备数据的实时采集与监控
利用数字化技术提升油气勘探的效率和成功率
钻井计划优化、实时监控和风险评估
提供业务洞察与决策支持实现数据驱动决策
原创|行业资讯|编辑:郝浩|2013-09-25 10:12:10.000|阅读 288 次
概述:在提供了容器支持如Visual Basic或Visual C++的开发环境中,barcode Xpress可以被作为一个ActiveX控件使用。在Visual C++中如何将Barcode Xpress作为一个导入的COM 对象使用呢?下面来具体的讨论一下。
# 界面/图表报表/文档/IDE等千款热门软控件火热销售中 >>
相关链接:
在前面的文章《Barcode Xpress使用教程:如何在Visual C++中作为COM对象使用(1)》中已经对在Visual C++中如何将Barcode Xpress作为一个导入的COM 对象使用的步骤做了一些讲解,下面将继续上文。
三、初始化COM
在COM函数可以被调用之前,这个必须先初始化COM库,并且在程序退出之前必须关闭。在ReadBarcodeFromDIB.cpp文件中像下面这样说明:
// CReadBarcodeFromDIBApp initialization BOOL CReadBarcodeFromDIBApp::InitInstance() { // Initialize the COM library on the current apartment and identify // the currency model as single-thread apartment (STA). Applications // must initialize the COM // library before they can call COM library functions other than // CoGetMalloc and memory allocation functions. HRESULT hRes = CoInitialize(NULL); AfxEnableControlContainer(); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif CReadBarcodeFromDIBDlg dlg; m_pMainWnd = &dlg; int nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: Place code here to handle when the dialog is // dismissed with OK } else if (nResponse == IDCANCEL) { // TODO: Place code here to handle when the dialog is // dismissed with Cancel } // Closes the COM library on the current apartment, // unloads all DLLs loaded by apartment, // frees any other resources that the apartment maintains, and // forces all RPC connections on the apartment to close. CoUninitialize(); // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application's message pump. return FALSE; }
四、创建BarcodeXpress COM对象
要使用BarcodeXpress,需要创建一个BarcodeXpress COM实例。在对象被创建之后,对象的属性和方法可以用于创建你的扫描应用程序。在ReadBarcodeFromDIB项目中,这个COM对象在 ReadBarcodeFromDIBDlg.cpp文件中如下创建:
// CReadBarcodeFromDIBDlg message handlers BOOL CReadBarcodeFromDIBDlg::OnInitDialog() { CDialog::OnInitDialog(); // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here CWnd* pControl = NULL; pControl = GetDlgItem(Description); if (pControl) { pControl->SetWindowText(lpctstrDescription); } CRect oIXArea; oIXArea.left = 25; oIXArea.top = 215; oIXArea.right = 725; oIXArea.bottom = 636; // Create an ImagXpress Object m_ppCImagXpress = new CImagXpress(this, 1, (long) m_hWnd, oIXArea.left, oIXArea.top, oIXArea.Width(), oIXArea.Height()); m_pImagXpress = m_ppCImagXpress->pImagXpress; m_pImagXpress->PutCtlVisible(true); m_pImagXpress->AutoSize = ISIZE_BestFit; m_pImagXpress->ScrollBars = SB_Both; m_pImagXpress->MenuSetEnabled(Menu_Context,TOOL_None, true); // **Initialize Barcode. You must call BC_Open before // **creating the first BarcodeXpress COM object. You cannot distribute applications using // **BarcodeXpress COM objects without valid unlock codes. // Create a BarcodeXpress class object. The BarcodeXpress // class object automatically creates a Barcode Xpress // COM object. m_ppIBarcodeXpress = new CBarcodeXpress(this, 1); // The SetSolutionName, SetSolutionKey and possibly the SetOEMLicenseKey method must be // called to distribute the runtime. Note that the SolutionName, SolutionKey and // OEMLicenseKey values shown below are only examples. // //m_pBarcodeXpress->SetSolutionName("YourSolutionName"); //m_pBarcodeXpress->SetSolutionKey(12345, 12345, 12345, 12345); //m_pBarcodeXpress->SetOEMLicenseKey("1.0.AStringForOEMLicensingContactAccusoftSalesForMoreInformation..."); // //m_pImagXpress->SetSolutionName("YourSolutionName"); //m_pImagXpress->SetSolutionKey(12345, 12345, 12345, 12345); //m_pImagXpress->SetOEMLicenseKey("1.0.AStringForOEMLicensingContactAccusoftSalesForMoreInformation..."); // Get the pointer to the created BarcodeXpress Barcode COM object. // This is the pointer that you will use to access BarcodeXpress // Barcode properties and methods. m_pBarcodeXpress = m_ppIBarcodeXpress->pBarcodeXpress; // Close the BarcodeXpress Barcode initialization. // You must call this AFTER creating the first BarcodeXpress Barcode // COM object m_1D.SetCheck(BST_CHECKED); m_selection = 0; m_pImagXpress->FileName = "..\\..\\..\\..\\..\\..\\Common\\Images\\Barcode All Supported Types.tif"; return TRUE; // return TRUE unless you set the focus to a control }>>>Barcode Xpress 下载
本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@fc6vip.cn
文章转载自:慧都控件在工业数字化和智能制造的进程中,设备互联、系统集成和数据安全是每个企业绕不开的话题。
随着人工智能(AI)的迅速发展,如何让AI系统与外部工具、数据源和服务顺畅协作,成为了技术开发中的一大挑战。模型上下文协议(MCP)为AI系统之间提供了标准化的连接方式,而SmartBear API Hub则为开发者提供了强大的工具集,帮助简化MCP开发过程,提升系统的可靠性和可扩展性。本文将深入探讨如何通过SmartBear API Hub高效应对MCP开发中的各种挑战,从而助力开发者构建更加稳
在功能安全领域,软件开发需满足严格的验证与确认要求。传统模式下,一般需要组合多种工具来完成不同阶段的测试。作为一款专注于代码质量和功能安全的自动化测试工具,Parasoft C/C++test 提供了静态分析、单元测试、覆盖率验证等能力的集成化测试解决方案,该工具通过TÜV SÜD权威认证,能够帮助企业系统化落实功能安全要求,降低合规难度。
在功能安全项目中,开发工具可信度是认证审核的关键。工具鉴定通常伴随巨大的工作量、复杂的文档和较高的项目风险。传统流程中,团队需耗费大量资源完成工具鉴定测试与认证文档准备。作为专注于代码质量和功能安全的自动化测试工具,Parasoft C/C++test 凭借“预认证背书”与“自动化认证工具包”的相结合,将复杂工作转化为标准化测试流程,从根本上帮助企业降低合规风险与成本。
服务电话
重庆/ 023-68661681
华东/ 13452821722
华南/ 18100878085
华北/ 17347785263
客户支持
技术支持咨询服务
服务热线:400-700-1020
邮箱:sales@fc6vip.cn
关注我们
地址 : 重庆市九龙坡区火炬大道69号6幢