Read a qt dll from a c# gui
-
this is not a question to be asked in Qt forum , your question is suited to be asked in a .net forum , but just a hint you should use Pinvoke technology to load the dll in a .net application make sure that all the qt modules dlls used in your qt dll and runtime dlls used is copied into the .net output folder
-
Thankyou for your answer. I have done it but it doesn't work.About i have some question:
-
I generated the dll using the "qt library" project inside vs2010. it is correct or have i to use the standard dll project of vs2010?
-
the dll has an interface od functions...it is not a class. Have I to use the class for the interface?
I'm very confused. Thanks in advance
-
-
-
what do you mean by qt library project ? if you have installed the binary distribution or if you have compiled qt correctly then you should have the qt library dlls at your hands
-
no , to provide native ( qt or non qt ) functionality to a .net application it doesn't have to be a class it is easier to be just methods
-
-
-
I installed in VS2010 the "VS Add-in with Qt5". In my vs2010 solution i have the project of the qt dll ("Qt Library" created inside VS2010), correctly compiled and linked.
-
so i have done right.
I post i piece of the interface:
#ifdef COMMQT_LIB
define EXAMPLEUNMANAGEDDLL_API Q_DECL_EXPORT
#else
define COMMQT_EXPORT Q_DECL_IMPORT
#endif
#ifdef __cplusplus
extern "C" {
#endifextern EXAMPLEUNMANAGEDDLL_API Comm* CreateCommClass();
extern EXAMPLEUNMANAGEDDLL_API void DisposeCommClass(Comm * pObject);
extern EXAMPLEUNMANAGEDDLL_API int CommGetNumEvents(Comm * pObject);#ifdef __cplusplus
}
#endifThankyou for your reply
-