From 0e5bcdb2d4d2e87e3624f14e5cc58a1d03de99fc Mon Sep 17 00:00:00 2001 From: wumu <mayi@mayi.com> Date: 星期二, 14 五月 2024 23:06:42 +0800 Subject: [PATCH] 0514 --- internal_system_v1/coverinfo.cpp | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/internal_system_v1/coverinfo.cpp b/internal_system_v1/coverinfo.cpp index a749448..cf28952 100644 --- a/internal_system_v1/coverinfo.cpp +++ b/internal_system_v1/coverinfo.cpp @@ -5,6 +5,7 @@ #include <QFileDialog> #include <QSqlQuery> #include <QSqlRecord> +#include "windows.h" int g_comId = 0; // 鍏ㄥ眬鍙橀噺锛屼繚瀛樺崟浣峣d QString g_dataRootPath; // 鏁版嵁鐨勬牴鐩綍 @@ -14,8 +15,10 @@ ui(new Ui::CoverInfo) { ui->setupUi(this); - readInfo(); - readDataFromSQL(); // 浠庢暟鎹簱璇诲彇鏁版嵁 + CoInitializeEx(NULL, COINIT_MULTITHREADED); // 鍏堝皢COM搴撳垵濮嬪寲 + + //readInfo(); + //readDataFromSQL(); // 浠庢暟鎹簱璇诲彇鏁版嵁 } @@ -58,6 +61,9 @@ qDebug()<<"index:"<<index; if(index > 0){ QAxObject excel("Excel.Application"); + if(!excel.setControl("Excel.Application")){ + excel.setControl("ket.Application"); // wps鍐呮牳 + } excel.setProperty("Visible",false); excel.setProperty("DisplayAlerts",false); qDebug()<<"open:"<<str; -- Gitblit v1.8.0