当前位置:网站首页>MFC integration QT verification and problem handling
MFC integration QT verification and problem handling
2022-07-29 08:25:00 【longlongway2012】
MFC Integrate QT
MFC Integrate qt There are many examples online , I'm just recording the problems I encountered in the verification process , So that people with the same problem will not run into a wall .
1. Create a single mfc dll Unable to export
QWinWidget Classes and QmfcApp Class QT_QTWINMIGRATE_EXPORT export , But the output is always incomplete , Later, I defined an independent export instead of the original macro
#ifdef QGUI_EXPORTS
#define QGUI_API __declspec(dllexport)
#else
#define QGUI_API __declspec(dllimport)
#endif
2. establish MFC After procedure , He quoted Qt File error
error C2061 Grammar mistakes : identifier “n”
original MFC Every cpp All in the document new It's overloaded :
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
This leads to the following code new Execution call error of :
QT_TRY {
while(current != to) {
new (current) T(*reinterpret_cast<T*>(src));
++current;
++src;
}
3. Generate QT After the project , Unable to run
After generation, you need to use windeployqt To publish , But I still can't run after publishing , Refer to other blogs , Turned out to be qtplugin Environment variables need to be configured
Error is as follows :
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Add environment variables :
QT_QPA_PLATFORM_PLUGIN_PATH=%QTDIR%/plugins
4. mfc When using multiple bytes, the input box is garbled :
Wide bytes are used by default ,mfc Input box is OK , When it is changed to multi byte, there will be garbled , It turned out , May not apply to qMfcApp::run, Messages can also be routed correctly :
int CMFCQtDlgTestApp::Run()
{
MainQTFrame mainUI;
mainUI.show();
//return QMfcApp::run(this);
return CWinAppEx::Run();
}
Reference website :
边栏推荐
- Intelligent shelf safety monitoring system
- Multifunctional signal generator based on AD9850
- AES bidirectional encryption and decryption tool
- Day4: SQL server is easy to use
- Dp1332e multi protocol highly integrated contactless read-write chip
- Tensorboard use
- New energy shared charging pile management and operation platform
- sql判断语句的编写
- DC motor speed regulation system based on 51 single chip microcomputer (use of L298)
- 为了速率创建线程池,启动核心线程
猜你喜欢

Solve the problem of MSVC2017 compiler with yellow exclamation mark in kits component of QT

Crawling JS encrypted data of playwright actual combat case

Proteus simulation based on 51 MCU ADC0808

Markdown concise grammar manual

Four pin OLED display based on stm32

Ga-rpn: recommended area network for guiding anchors

Charging pile charging technology new energy charging pile development

Reading papers on false news detection (4): a novel self-learning semi supervised deep learning network to detect fake news on

MySQL rownum implementation

Inclination sensor accuracy calibration test
随机推荐
Qt/pyqt window type and window flag
A problem encountered in SQL interview
Virtual augmentation and reality Part 2 (I'm a Firebird)
Domestic application of ft232 replacing gp232rl usb-rs232 converter chip
SQL 面试碰到的一个问题
Unicode private use areas
Windows 安装 MySQL 5.7详细步骤
Collation of ml.net related resources
leetcode hot 100(刷题篇9)(301/45/517/407/offer62/MST08.14/)
Day4: SQL server is easy to use
Node: file write data (readfile, WriteFile), two modes: overwrite and increment
ROS common instructions
数仓分层设计及数据同步问题,,220728,,,,
Random lottery turntable wechat applet project source code
Chrony time synchronization
Unity多人联机框架Mirro学习记录(一)
torch.Tensor.to的用法
Basic crawler actual combat case: obtaining game product data
Ga-rpn: recommended area network for guiding anchors
Day5: PHP simple syntax and usage