PDA

View Full Version : How to use a Dynamic Link Library with QT / C++.



nivaldonicolau
28th April 2009, 18:06
Hello people.

I'm trying to learn how to program under this enviroment and i dont figured out yet how to use a DLL on my project.

The problem is that I'm developing a tool that needs to comunicate with another software, to retrieve some information about my process.

That communication is possible through a SDK dll, provided by the developer.

The problems are:

1) How to add a reference to this dll?

2) After adding the reference, how to create a new instance of a class defined by the dll?

Please help me!

wysota
28th April 2009, 19:44
How would you do that if you weren't using Qt?

nivaldonicolau
28th April 2009, 20:38
How would you do that if you weren't using Qt?


Well... actually I know how to do this only using VB.

There is a built-in menu where you can add the external references to your program.

After adding these references, to create a new instance the code seems like this:


Dim MyObject as iHistorian_SDK.Server
Set MyObject = new iHistorian_SDK.Server

Was it clear?

wysota
28th April 2009, 21:00
Please use your favourite search engine to find articles about using external libraries with C++. This is out of scope of this forum. As for Qt, use our search facilities - the issue of configuring your project to use external libraries has been brought up a couple of times. You can even scroll this thread down to the list of similar threads and read them.

nivaldonicolau
29th April 2009, 11:30
Please use your favourite search engine to find articles about using external libraries with C++. This is out of scope of this forum. As for Qt, use our search facilities - the issue of configuring your project to use external libraries has been brought up a couple of times. You can even scroll this thread down to the list of similar threads and read them.


wysota,

Thanks for replying.

By the way... at the first time... I thought that I had to use the QLibrary class (out of scope?! I dont think so) to implement this issue. But i did'nt figured it out.

wysota
29th April 2009, 14:05
I thought that I had to use the QLibrary class
Not really. This is for loading libraries at runtime not when the application is started.

Qt is not some special magic entity that forces you to do think you don't have to do with C++ or any other language similar to it. It just adds some more functionality.