Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. Problem calling Qt DLL made with into vb.net project
Qt 6.11 is out! See what's new in the release blog

Problem calling Qt DLL made with into vb.net project

Scheduled Pinned Locked Moved Language Bindings
4 Posts 2 Posters 2.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    daniel__
    wrote on last edited by
    #1

    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 corrupt

    Thought 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

    1 Reply Last reply
    0
    • C Offline
      C Offline
      cincirin
      wrote on last edited by
      #2

      I don't know if above code you posted was compiled in dll project, because from what I see line 10 is wrong. "scene" variable is already a pointer, so don't need to pass address of pointer in QGraphicsView constructor.

      1 Reply Last reply
      0
      • D Offline
        D Offline
        daniel__
        wrote on last edited by
        #3

        thank you cincirin,
        the line 10 is not executed yet because the error happens on line 9.
        i'm gonna think that i can't use views in shared library
        i really need help
        :(

        1 Reply Last reply
        0
        • C Offline
          C Offline
          cincirin
          wrote on last edited by
          #4

          [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)

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved