自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

詳解 Qt 下 QLibrary 動(dòng)態(tài)加載 dll

移動(dòng)開(kāi)發(fā)
本文介紹的是Qt 下 QLibrary 動(dòng)態(tài)加載 dll,內(nèi)容很充實(shí),先來(lái)看內(nèi)容。

Qt QLibrary 動(dòng)態(tài)加載 dll是本文要介紹的內(nèi)容,先來(lái)配置環(huán)境,測(cè)試平臺(tái):Windows XP Sp3 + Qt 4.5 + Compaq Visual Fortran Version 6.6。

下了個(gè)Qt Creator功能挺強(qiáng)大的,測(cè)試一下QLibrary動(dòng)態(tài)加載VS下編譯的Fortran寫(xiě)的dll。在pushButton上建立click()信號(hào)的槽

  1. #include "mainwindow.h"  
  2.  
  3. #include "ui_mainwindow.h"  
  4.  
  5. #include <QLibrary> 
  6.  
  7. #include <qtextcodec.h>        //解決中文顯示所需的庫(kù)  
  8.  
  9. MainWindow::MainWindow(QWidget *parent)  
  10. : QMainWindow(parent), ui(new Ui::MainWindowClass)  
  11. {  
  12. ui->setupUi(this);  
  13. QTextCodec::setCodecForTr(QTextCodec::codecForLocale());   //設(shè)置中文顯示,使用本地字庫(kù)  
  14. connect(ui->OKButton,SIGNAL(clicked()),this,SLOT(close()));     //將OKButton的Clicked()信號(hào)幫定close()槽  
  15. }  
  16. MainWindow::~MainWindow()  
  17. {  
  18. delete ui;  
  19. }  
  20. void MainWindow::on_OKButton_2_clicked()        //OKButton_2的槽  
  21. {  
  22. ui->label->setText(QApplication::translate("MainWindowClass", "aaa", 0,QApplication::UnicodeUTF8 ));    //另一種文本轉(zhuǎn)換方法,不知有啥優(yōu)點(diǎn)...  
  23. int a=1,b=2,c=6;  
  24. typedef void (*myfun)(int,int,int *);       // 定義導(dǎo)出函數(shù)類(lèi)型  
  25. QLibrary hdll( "test01.dll" );        //加載dll,當(dāng)前目錄  
  26. if(hdll.load())  
  27. {  
  28. myfun fun1 = (myfun)hdll.resolve("MYSUB");        //用resolve來(lái)解析fun1函數(shù)  
  29. if ( fun1 )       //解析成功則進(jìn)行運(yùn)算并提示相關(guān)信息  
  30. {  
  31. fun1(a,b,&c);  
  32. QString qss=tr("dll加載成功!\n 1+2=")+QString::number(c,10);  
  33. ui->label->setText(qss);  
  34. }  
  35. }  

運(yùn)行結(jié)果:

詳解 Qt 下 QLibrary 動(dòng)態(tài)加載 dll

Qt Creator 編輯界面:

詳解 Qt 下 QLibrary 動(dòng)態(tài)加載 dll

PS:minGW編譯Qt,速度太慢了~

小結(jié):詳解 QtQLibrary 動(dòng)態(tài)加載 dll 的內(nèi)容介紹完了,希望本文對(duì)你有所幫助,更多內(nèi)容請(qǐng)參考編輯推薦!

責(zé)任編輯:zhaolei 來(lái)源: CSDN博客
相關(guān)推薦

2011-06-23 14:27:48

QT QLibrary 動(dòng)態(tài)庫(kù)

2011-06-28 13:12:07

Qt 調(diào)用 DLL DLL

2009-09-25 11:04:07

C++動(dòng)態(tài)加載DLL

2011-06-16 10:09:25

QT Windows DLL

2011-06-16 13:56:48

Qt Symbian DLL

2011-06-27 16:59:19

Qt 動(dòng)態(tài) 插件

2011-06-29 09:56:29

QT UI 動(dòng)態(tài)加載

2011-06-30 13:37:29

MFC Qt 多國(guó)語(yǔ)

2011-06-30 09:46:01

QT 顯示視頻 linux

2011-06-24 17:05:07

QT QT 4.7.3 windows

2024-03-01 20:59:11

C#DLL開(kāi)發(fā)

2011-06-23 10:16:55

VS2010 QT 4.7.2 QT

2011-07-01 12:52:50

Ubuntu Qt wxWidgets

2011-06-24 13:27:13

Ubuntu QT SDK

2009-10-27 10:28:33

Silverlight

2011-06-29 10:18:20

LINUX QT ARM

2024-05-27 09:52:57

反射技術(shù).NET動(dòng)態(tài)庫(kù)

2021-10-24 06:50:52

AndroidClassLoaderJava

2011-06-24 10:05:51

QT 對(duì)象 父對(duì)象

2011-07-05 09:35:52

Ubuntu Qt Mysql
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)