Get Windows Handler (hWnd) from HDK

   3914   4   0
User Avatar
Member
26 posts
Joined: 3月 2008
Offline
I get this strange “problem”, where adding my own custom SOP to Houdini, the SOP doesnt show up directly, and the Geometry Window seems to have “frozen” for couple of seconds.

If you wait, or press tab and click around, the SOP appears and everything works fine again. So its not really a problem, just a annoying issue.
So I tracked down the issue, and it turns out to be this function I call to a custom dll file. This function wants to have a windows handle, and I have sofar ignored to send in the windows handler, since it didnt seem to be needed.

So I wonder if there is a way to get the Windows Handler (hWnd) pointer through the HDK?
You cant recycle wasted time
User Avatar
Member
7871 posts
Joined: 7月 2005
Offline
In general, SOP cooking is independent of UI. For example, a SOP may be cooking in hbatch or hython, in which case, no windows are ever created. I think you will need to examine precisely why an HWND is necessary. If it's just someone wanting to use it a parent window for MessageBox(), then using NULL should be ok.
User Avatar
Member
26 posts
Joined: 3月 2008
Offline
Ok, thanks! I will see if I can find out what the handler is really needed in that function.

As far as I know (looking in the documentation), this function creates a pointer to a context object, which is the main part of the SDK I am using. This object creates/destroys objects, access other stuff and load/saves files and so on. So I would assume its used for something more than just Messageboxes. But I will dig deeper to make sure.
You cant recycle wasted time
User Avatar
Member
26 posts
Joined: 3月 2008
Offline
I have been asking around, and people doesnt seem quite sure of why the handle is needed, but say that its always good to give the handle anyway.
I could ask the support, but I thought trying with the handle first would save time.

So, lets say I need that windows (hWnd) handler. Is it possible for me to get it through the HDK (Im sitting on Houdini 8.2)?

Another interesting quirk I have also noticed, with this issue, is that this “issue” only happens when I add my SOP after I have added some other SOP. So, if I start Houdini, add my SOP, then it works fine…
You cant recycle wasted time
User Avatar
Member
7871 posts
Joined: 7月 2005
Offline
<shrugs> It's hard to say since it only occurs in some black box code. You could always try to explicitly call CreateWindow() [msdn.microsoft.com] and pass that HWND into it.
  • Quick Links