Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How do I get the Windows HINSTANCE handle?
Forum Updated to NodeBB v4.3 + New Features

How do I get the Windows HINSTANCE handle?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 13.8k 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.
  • C Offline
    C Offline
    chrisharden
    wrote on last edited by
    #1

    Hi Guys,
    I am integrating an SDK that requires access to the HINSTANCE handle that Win32 provides in its WinMain call like this:WinMain(HINSTANCE hInstance,.....

    I have tried QApplication::instance(), but that doesn't seem to be satisfactory to the SDK that needs the handle.
    Does anyone know what procedure I need to call?

    Thank you, :)
    Chris

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Scylla
      wrote on last edited by
      #2

      So I think you are looking for "WId QWidget::winId () const" from your mainwindow and not from the application object.

      1 Reply Last reply
      0
      • G Offline
        G Offline
        giesbert
        wrote on last edited by
        #3

        If you really need the HINSTANCE, you can use

        @
        HINSTANCE hInstance = (HINSTANCE)::GetModuleHandle(NULL);
        @

        Nokia Certified Qt Specialist.
        Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

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

          Thank you both.

          I have tried both solutions (plus about 3 others), but the SDK doesn't seem to be responding. I believe I will need to compile and debug within the SDK - something else must be going on.

          Thanks agian for your help and quick replies - sincerely appreciated! :)
          Chris

          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