Problem calling Qt DLL made with into vb.net project
-
hi everybody,
i'm really new to qt so i excuse for my eventually stupid questions.
my target is to make a shared library dll in qt that i can use in a vb.net project.
I followed all the possible tutorials and forums about how to create something like this and for test i create a stupid 'multiple' library.
Then i tried to evolve my dll to make what i need (a dll that creates a graphic file using some functions like word spacing and shadows that i can't do with gdi+) the idea is to pass this image from qt dll to my vb.net project.below the first lines of my sub in the dll where it crashes
@
int QTRender::Draw()
{QGraphicsDropShadowEffect* effect = new QGraphicsDropShadowEffect(); bool external_color; int text_flags; QPixmap pixmap (800,480); //making bg image QGraphicsScene *scene = new QGraphicsScene(); ------ THIS IS THE LINE THAT CAUSES THE ERROR QGraphicsView view(&scene);
@
when that line it's called by my .net project i receive the following error:
Attempted to read or write protected memory. This is often an indication that other memory is corruptThought it was caused by a bad Qt declaration made by me but this error happens only with QGraphicScene object.
Hope someone could help me. i will appreciate every help
thank you -
[quote author="daniel__" date="1353055182"]i'm gonna think that i can't use views in shared library
i really need help
:([/quote]
First, you need to create QAplication. Next don't call QApplication::exec in dll because will block host application events. Instead call QApplication::processEvents periodically (e.g. in some timer function)