GUI in a DLL:

Started by
7 comments, last by athono 17 years, 11 months ago
GUI in a DLL: I want to launch an SDK/WIN32 GUI DLL from a seperate executable. I am pretty sure this has to be a multi-threaded application in order to do this. Has anyone else tried such a thing?
Advertisement
Well, if you want to make a call to the DLL to launch the GUI and have it return immediately while the GUI is running, then, yes, it needs to be multithreaded (because there would need to be a thread running the event handling loop). However, just wanting to launch a GUI from inside a DLL does not inherently require multithreading.
Quote:Original post by nimrand
Well, if you want to make a call to the DLL to launch the GUI and have it return immediately while the GUI is running, then, yes, it needs to be multithreaded (because there would need to be a thread running the event handling loop). However, just wanting to launch a GUI from inside a DLL does not inherently require multithreading.


I am looking for a good sample/example code of this online somewhere. So far I have not been lucky in finding one.

I don't know of any online examples or tutorials off hand. There's not really any difference between creating a WIN32 GUI from a DLL that it would be from the executable itself. I've done similar things myself, but I'm not 100% clear on what you're trying to do. If you could give me a little more detail about your project and why you want to do this, I might be able to point you in the right direction.
I have one [smile] a dated snapshot of the code is here and a demo here, I did the best to keep all the code documented, but it can be hard to grasp at times.

It is FAR from complete.


Edit: Oh, you mean Windows API GUI, maybe a resource DLL containing the message pump as well could work... but what else is there to a program?
Quote:Original post by Anonymous Poster
I am looking for a good sample/example code of this online somewhere. So far I have not been lucky in finding one.

You don't need one. Just write the code.
How do I open a window in a seperately called thread of execution?

I cannot do it in MFC because MFC requires its own thread of execution.

But even when I create a windows app without MFC, it seems entry point. _t winMain is called by an main thread of execution nested in a microsoft routine. I want my own thread to call my own winmain. How do I do this?

(Maybe I need to look at the mozilla open source to see how to do this if they do it)

Do you remember those old-fashioned SDK programs that would have this giagantic message loop? I think this is exactly what I need to find an example of. Has anyone seen one around?
I think you're confused...

In a common win32 app you have the winmain which is the application entry point. No window depends on this function (beyond being responsible for creating and keeping the app instance).

The message loop you're talking about is the window procedure aka wndproc, winproc, which is a static callback function that is passed to the window to handle the messages.

from a single winmain you can launch multiple threads and multiple windows on each thread, you can have different wndprocs for each window or handle many with the same.

I yet have to understand your original intention for being somewhat handy here...
[size="2"]I like the Walrus best.
Quote:Original post by owl
I think you're confused...

In a common win32 app you have the winmain which is the application entry point. No window depends on this function (beyond being responsible for creating and keeping the app instance).

The message loop you're talking about is the window procedure aka wndproc, winproc, which is a static callback function that is passed to the window to handle the messages.

from a single winmain you can launch multiple threads and multiple windows on each thread, you can have different wndprocs for each window or handle many with the same.

I yet have to understand your original intention for being somewhat handy here...


Thanks for this information.

Are all these win32 api's done without the aid of the microsoft foundation class libraries?

There is some discussion in my group that we need to use MFC. But my experience is that with large projects it is often better not to use it because you have more ability to manage the code. Any thoughts on this?

This topic is closed to new replies.

Advertisement