3 ms·
What if "the binary" is stock (not built or relinked by you) installation of a language run-time? That's more like the case I'm thinking of. A program like thi
by kazinator 1y ago
What if "the binary" is stock (not built or relinked by you) installation of a language run-time? That's more like the case I'm thinking of.
A program like this nicely translates to that situation.
- int_19h 1y agoI don't understand this scenario. If you're writing an .rc file, then by definition you are building your own app (or library, although having one that displays dialogs is rather unusual). Are you talking about localizable text, by chance?
- kazinator 1y agoWhat if the app isn't in a language that links to an .exe, where we can include the .res file compiled from .rc? The language may have an .exe run-time, but we don't get to link that. In that case if we want to use a .rc file anyway, it seems we would want to create a resource DLL out of it and dynamically load it. (I'm aware that one reason for resource DLL's is for localizable strings. That use makes sense even of programs which can statically link the GUI layout resources.)
- int_19h 1y agoAh, I see what you mean now. But the context is a Win32 app that is very deliberately written in C, so my take was from that perspective - i.e. there's no good reason to avoid .rc files and instead handwrite CreateWindow, handle DPI etc in this case. However, even in the case that you describe, you don't actually have to use a resource DLL. CreateDialogIndirect can be used to create a dialog from an array of DLGITEMTEMPLATE structs, each describing a single control. I'm not entirely sure, but I suspect that compiled dialogs are basically just a dump of that array (but if not you could always just create it manually).