Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    How do I get the Windows HINSTANCE handle?

    General and Desktop
    3
    4
    12732
    Loading More Posts
    • 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
      chrisharden last edited by

      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 Reply Quote 0
      • S
        Scylla last edited by

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

        1 Reply Last reply Reply Quote 0
        • G
          giesbert last edited by

          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 Reply Quote 1
          • C
            chrisharden last edited by

            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 Reply Quote 0
            • First post
              Last post