Sign in to follow this  

DLL problem with a window

This topic is 4842 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 am currently working on a game engine(DLL) that is going to work with all .NET languages. I was assigned the DirectX part, but since this is my first time with DLL's, let alone working on a game engine (other than a small personal one), I have a problem. I need a window for DirectX to run in. Should I (a)request the appropriate variables from the calling application, or (b)create a window inside of the DLL. With option (a), I am not sure if Visual Basic had such variables, etc. But with option (b), I do not know how to request an instance manually instead of by the argument list in WinMain(<various vars>), and also, if I did do that, would the window last outside of the creation function? I appreciate any help and thank you in advance. I also apologize if I do not make sense or have confused something/done something stupid.

Share this post


Link to post
Share on other sites
You can do it in the DLL. GetModuleHandle(0) will return an hInstance for you to use. Also, DllMain has an instance too. It's called on LoadLibrary.

If you decide to let the programmer create the window himself, just pass the handle to the create function. VB does have a way to do that (last I checked it was Form.hwnd).

Share this post


Link to post
Share on other sites

This topic is 4842 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this