PDA

View Full Version : Dispatcher between Qt DLL and C#



NoRulez
27th August 2009, 08:06
Hey @all,

i stand for the following problems:
1.) I have a Qt DLL which I must embed into an C# Project
2.) I have a C# DLL which I must embed into a Qt Project

For both situations i've read something about "dispatcher" classes/DLL's.
Can anybody give an example on how i must do it?
A simple "Hello World" example were a great help.
Other .NET languages must also be supported in the future.

Maybe someone can give me some help, because I've never written programs with .NET before.

Thanks in advance

Best Regards
LG NoRulez

victor.fernandez
27th August 2009, 09:09
I don't have experience with .NET but if you want to use Qt with C# you may use Qt#, which are the C# bindings for Qt:

http://freshmeat.net/projects/qtcsharp/

NoRulez
27th August 2009, 09:11
The problem by this is that it must be pure .NET without bindings. Sorry i forgot this to say by my first post.

Regards NoRulez

wysota
27th August 2009, 10:26
You have to have some kind of bindings if you want to go between C# and C++. Find a C# class that will let you call a C++ library (or a C function), wrap your Qt code into a proper interface that will be callable from C# (that's your binding) and compile it as a library and then call it from your C# code. Remember to provide some means to periodically process Qt events (i.e. by periodically calling QApplication::processEvents() from C# code).