Qt using shared COM Object - qt

I have an shared dll file (COM, registered with regsvr32.exe) written by (I think with delphi) 3rd party company. But I havent .lib or any header file about this library. This library have a few objects, interfaces and functions. I can't find how to use exported objects, interfaces and functions on internet. Can anybody explain this with example? I can use this library with c# with success.
EDIT:
I think, I must use this http://doc.qt.nokia.com/4.7/activeqt-dumpcpp.html

Check the QAxContainer classes.
The QAxContainer module is a Windows-only extension for accessing
ActiveX controls and COM objects.
Also check the Using ActiveX Controls and COM in Qt page from the Qt documentation

Related

Difference between portable class library and shared class library in Xamarin cross platform

Can any one explain the difference between portable class library and shared class library in Xamarin cross platform
Just my understanding about them.
shared class library works as static library (shared source code) and portable library likes a dynamic library.
A portable library is a compiled piece of code that is referenced by other projects; the result of compilation is an assembly that is loaded by the referencing app at runtime. A shared project is not compiled into a stand-alone assembly; instead, all of the code in the project is included in the compilation of the referencing project as if you had added the files that are in the shared project directly to the referencing project. There are pros and cons to both approaches, but it seems that the community is gravitating towards PCLs. There are cases where the use of Shared Projects is still necessary, though (OpenTK being one such example).

Create a Qt library to be used in a non-Qt application

I created a Qt static library following the instruction here:
http://qt-project.org/wiki/How_to_create_a_library_with_Qt_and_use_it_in_an_application
Then I tried to link the library with my own (non-Qt) application, and GCC complained about undefined references. Examining the library content using Linux nm utilty I found the function I intend to call has cryptic letters added before and after it.
Reading the instruction from the instruction link more closely, it suggests that I need to use use an import define so the right Qt macro can be called to import the function (which I assume renames the function to match the naming scheme in the library). But I don't really want to introduce Qt dependency in my main application.
What I really want to do is to build a UI frontend library with Qt, and my main application will simply link to it without having any Qt dependency. Is this possible? Or am I using Qt in an unintended manner?
Thanks.
It sounds like you're running into C++ namespace mangling. Try adding an 'extern "C" {}' block around your libraries export.
The main point of the QLibrary::resolve function is to provide an abstraction layer so you don't have to worry about the win32 command or the linux command for resolving a symbol. It shouldn't be necessary to use a library created with Qt.

How to reference an x86/x64/ARM class library (not an AnyCPU class library) in WinRT

In mvvmcross, I've got a plugin class library which references SQLite for WinRT.
Because of this, I can't build that class library as AnyCPU - instead, I have to reference it as x86, x64 or Any CPU.
This means that new client applications can't just reference a single DLL, but instead individual configurations must reference different input assemblies. Currently I'm doing this by manually editing the .csproj file using conditions.
However, this is a bit error prone (and a bit hard to explain!)
Is there any 'easy' way (1 click way) for client applications to reference the x86/x64/ARM class library trio so that MSBuild then picks the right version at runtime?
If your application does not rely on perfect performance, you might switch to C# SQLite, which is purely managed (Any CPU), so that your class libraries and executable can be set as Any CPU.
Alternatively, you might use Dependency Injection or MEF to inject the assemblies/types of correct bitness at runtime, and in this way at compile time you always work against an interface (which is bitness independent).
As far as I know, MSBuild cannot automatically handle bitness in the way you wanted.

Grab current OpenGL context with Qt

I have written a Qt based dll with some OpenGL calls. If I load my DLL from my Qt application with QGLWidget used for rendering, a call to QGLContext::currentContext from the DLL returns the correct context. But if use my DLL in a non Qt based program there is no QGLContext returned. As a result I couldn't use QGLShaderProgram in non Qt based apps.
What I am doing wrong?
P.S. Direct calls to glCreateProgram and so on in my library seem to work fine, but I want to use Qt classes.
I want to use Qt classes.
Then you should use your DLL in an application that uses Qt. By requiring the Qt classes, your DLL now requires Qt. If you want your DLL to work when Qt isn't available, then you shouldn't use Qt.
Besides, the Qt classes for shaders and programs aren't anything you couldn't whip up in 30 minutes.

Undefine symbol from Qt library

I create a static library using Qt library. But when I use this created static library and link to my application, then the problem is it will give me undefine symbol of QImage.
Please advise.
Many thanks.
some error message:
undefined reference to `QImage::~QImage()'
You need to link the application with your library AND Qt libraries.
You library is not linked to Qt.
When you create a a static library, it doesn't pull in everything from QT. It pulls in only the object files to satisfy the undefined symbols.
So you still need to link with QT libraries.

Resources