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. WinId issue with Qt?
Forum Updated to NodeBB v4.3 + New Features

WinId issue with Qt?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.5k 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.
  • S Offline
    S Offline
    starbearer
    wrote on last edited by
    #1

    Hello,

    I've a QMainWindow.

    For certain reasons, mostly to do with registration of messages to another application, I need to register with the winID, of this QMainWindow.

    Now when I call this function, let's say..

    @
    RegisterMultipleMmiPgm (_T("P14CondView"), mainWin->winId() , MMIOPT_ALLOW_MULTIPLE_INST);
    @

    Here, when I see the properties of mainWin ( which is derived from QMainWindow), I see the WinId, as some negative number and it says it is unused...

    Is that usual? Because I'm not getting the expected behaviour with this, and the application seemingly fails to register with the external application.

    Could anyone tell me whether this is expected, i.e. whether winId should be a negative number and marked "unused" in VS2010.

    Thanks...

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      On Windows winId() is actually a HWND, which is defined as void*, and since there's no such thing as a negative address, probably for some reason you're interpreting it as a signed type, which it is not.

      As to why it doesn't work - I don't know but what is the expected parameter type of the RegisterMultipleMmiPgm? If it's something like 'int' then it's probably it - it's doing a cast from a pointer to a signed integer.

      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