智能终端定制开发 ad
MTK/瑞芯微/高通-Android,智能模块/智能终端方案商

深度定制各类智能终端和智能硬件产品,提供硬件选型咨询、参考设计、元器件推荐、驱动开发、行业模块集成、操作系统定制与算法集成等软硬件定制服务。
contact.aspx

Android核心板产品覆盖2G、3G、4G通讯,双核、四核、八核CPU,可选的平台有MTK6580、MTK6737、MTK6750等,Android版本有5.1 6.0 7.0等。
contact.aspx

可广泛应用于低端智能POS、安防监控、车载设备、低端智能机器人、智能家居、智能硬件、工业智能手持设备、低端智能对讲设备、低端警务或执法设备、智能穿戴、贩卖机、物流柜、智能门禁系统等行业和设备。
contact.aspx

可提供以太网转串口透传,WIFI转串口透传,蓝牙转串口透传,CAN总线模拟量控制输出模块等。
contact.aspx

带3G或4G通讯功能,运行android系统,有多个串口,可以外挂各种模块:条码扫描、RFID、指纹识别、身份证识别、磁条卡、ID卡、GPS/北斗模块等。
contact.aspx

具有4G通讯功能,多个RS232或RS485接口,以太网接口,USB接口,CAN接口,多个AD输入。基于Android系统智能平台,方便APP应用开发。器件严格选型,运行稳定,质量可靠。
contact.aspx

调用HHA_CompileHHP编译chm工程
[VC 编程] 2008-04-03



作者:吴会然

下载源代码

编译chm工程(.hhp)有两种方法:

  1. 调用hhc.exe
  2. 调用HHA_CompileHHP

调用hhc.exe编译,代码如下:

// strChmFileName为你的hhp文件的长文件名 CString strCmdLine; strCmdLine = "hhc.exe "; strCmdLine += strChmFileName; WinExec(strCmdLine, SW_SHOWNORMAL);
  用这种方法调用有很多缺点,首先,没有编译进度,没有任何提示,根据我的测试,还不支持有空格的文件名。一般专业的chm制作软件都是调用的hha.dll中的HHA_CompileHHP函数进行编译。我们这里不讨论如何生成chm的工程文件,这个可以参考Html Help WorkShop生成的文件。调用HHA_CompileHHP,微软没有提供函数声明,也没有提供帮助信息。(据说要和微软签订协议,才可以拿到函数声明及相关的头文件)参考了网上一篇介绍用delphi实现函数调用的文章,加上我的一点试验,终于我VC实现了。ok,看看我是怎么实现的。

先说下HHA_CompileHHP的参数:

  • (const char*, LPVOID, LPVOID, int)
  • 第一个参数为你要编译的hhp文件名
  • 第二个参数是编译日志回调函数
  • 第三个参数是编译进度回调函数
  • 第四个参数不知道什么用,我把他置为0

开始写代码了

/////////////////////////////////// // 下面是两个回调函数的声明 BOOL CALLBACK FunLog(char* pstr); BOOL CALLBACK FunProc(char* pstr); // // CompileHHP // // 参数:pzFileName为待编译hhp文件名 // 作者:吴会然(wuhran@126.com) // blog: http://blog.sina.com.cn/u/1272907062 //////////////////////////////////////////////////////////////////////////////////// void CCompileCHMDemoDlg::BuildChmFile(CString strHHPFile) { HINSTANCE hinstLib; typedef BOOL (WINAPI *MYFUNC)(const char*, LPVOID, LPVOID, int); BOOL fFreeResult, fRunTimeLinkSuccess = FALSE; MYFUNC ProcAdd = NULL; // Get a handle to the DLL module. hinstLib = LoadLibrary("hha.dll"); // If the handle is valid, try to get the function address. if (hinstLib != NULL) { ProcAdd = (MYFUNC) GetProcAddress(hinstLib, "HHA_CompileHHP"); // If the function address is valid, call the function. LPCSTR pzFileNmae = strHHPFile.GetBuffer(strHHPFile.GetLength()); if (fRunTimeLinkSuccess = (ProcAdd != NULL)) { if(ProcAdd(pzFileNmae, FunLog, FunProc, 0)) { } } // Free the DLL module. fFreeResult = FreeLibrary(hinstLib); } if(m_pStatusBar) m_pStatusBar->SetPaneText(0, "编译完成!"); // If unable to call the DLL function, use an alternative. if (! fRunTimeLinkSuccess) printf("message via alternative method\n"); } ////////////////////////////////////////////////////////////////////////////////////// // FunLog() // 编译日志回调函数 // 参数:日志字符串 // 作者:吴会然(wuhran@126.com) // blog: http://blog.sina.com.cn/u/1272907062 //////////////////////////////////////////////////////////////// BOOL FunLog(char* pstr) { ASSERT(pstr); CString strMsg; strMsg.Format("%s", pstr); // AfxMessageBox(strMsg); return true; } ////////////////////////////////////////////////////////////// // // FunProc() // 编译进度回调函数 // 参数:进度字符串 // 作者:吴会然(wuhran@126.com) // blog: http://blog.sina.com.cn/u/1272907062 ////////////////////////////////////////////////////////////// BOOL FunProc(char* pstr) { ASSERT(pstr); CString strMsg; strMsg.Format("%s", pstr); // AfxMessageBox(strMsg); return true; }
联系方式:
wuhran@126.com
http://blog.sina.com.cn/u/1272907062

上面的测试代码在VC6.0+WIN2003下编译通过,请确保你的系统目录或程序当前目录下存在hha.dll文件。

欢迎大家交流指正……
[VC 编程添加评论 | 评论/阅读(0/274)
评论
昵称
主页
内容
递交


Copyright @ 我的开发笔记     2008 - 2017         粤ICP备19155526号-1