PDA

View Full Version : How to use a c# function or dll in a Qt project



synpro85
3rd June 2014, 15:25
Hi everyone, i'm developing a little project using Qt, and i need to use a function written in C#, i have read about qyoto,mono,smoke, but i did not understand very much about it, so can somebody explain me if there's a way to do it, or if not, can you explain me a different way to do it?
Thank you so much, and sorry for my english, i'm italian :P and i'm a newbie in Qt programming :D
i'll wait for your kind aswers =)
BYE :thumbsup:

anda_skoa
5th June 2014, 18:52
Does the DLL export the usual C style interface or is it just managed code without any native interface?

In the first case you should be able to use the C API just like for any other Windows DLL.

Cheers,
_

synpro85
6th June 2014, 08:24
Well my real problem is that i've to manipulate a ref cursor returning by a postgresql db, but in Qt i did not find any solution, so i have a c# function that makes it, i know that qt can use it, but i don't know how ;) Sure, if i found how to manipulate ref cursors with Qt's libraries it's so much better, but googling i didn't find anythitng helpull :(
anyway thank you for answering :)

anda_skoa
6th June 2014, 20:20
Using a C# library to work with PostgreSQL sounds like a rather convoluted approach.

If the abstraction provided by QSql does not expose the feature you need, why not use the PostgreSQL API directly?

Cheers,
_

synpro85
9th June 2014, 08:20
oh thanks for the idea,but my problem now becomes : "how to use pg api in qt?" i started very recently with qt, so i don't know how to use external api :confused:

anda_skoa
9th June 2014, 09:26
I don't know the PG API but I expect it to be a C API.

So you add the path to its includes to your INCLUDEPATH variable and and the library and its path to the LIBS variable of your .pro file

Cheers,
_

synpro85
10th June 2014, 13:27
all right i'll try XD thanks XD