Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Passing HWND's

This topic is 6116 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''ve been digging deeper into engine structure with DLL''s and found a (to me) nasty problem. As we all know, DirectX and OpenGL needs access to an HWND. If you conbine two of these parts (e.g. DirectInput and OpenGL) they need to have access to the SAME HWND and there''s my problem. At my current state, I''ve got 2 DLL''s (Audio and Video) and 1 executable (Main.exe) I know need a way for all these 3 parts to use the SAME hwnd. Is there someone out there that can throw me a candle over this problem?

Share this post

Link to post
Share on other sites
Well, I guess that the Audio dosen''t need it''s own unique HWND. Only the video does (for the window to draw to)
My idea:
Create a window in main.exe
Pass that HWND to some init function that is in each DLL


//A line in the .H file for Audio
bool InitAudio(HWND AppHwnd);

//A line in the .H file for Video
bool InitVideo(HWND AppHwnd);

//Include both of these in the main.exe and in the WinMain()
//...Create Window

//In each DLL create a global variable that holds the HWND passed to it.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!