yottaawesome / onyx32

An experimental C++ Win32 DLL-based framework.
MIT License
2 stars 0 forks source link

Trying to learn your code base #2

Open manuva1 opened 4 years ago

manuva1 commented 4 years ago

What are the techniques you are using to piece together everything cohesively. Do you have articles you know of i code use to better understand your code. For instance IMessageable how does this class works in the overall scheme of your framework i have many more questions. I have alot to learn from your framework want to know the functions for some of the classes and in what situations you have run into coding something like a win32 api wrapper such as yours. Thanks Best Regards

yottaawesome commented 4 years ago

Hi manuva1.

Thanks for your queries! I'll attempt to answer them as best as I can.

What are the techniques you are using to piece together everything cohesively.

This is a bit of a broad question, but I've basically tried to arrange the underlying Win32 concepts and functions into coherent and higher-level C++ objects contained within a DLL. For example, in the GUI DLL, I've created C++ objects to represent the lower-level Win32 buttons, dates, text inputs, and windows. Architecturally, I've tried to separate out the lower-level Win32 function calls for creating and managing the message pump into the Win32.

Where possible, I've tried to consolidate code by using abstract classes and inheritance while using newer and more modern C++ techniques, such as lambdas. I've also used interfaces exported from Onyx32.Gui.dll to prevent clients from knowing the underlying implementation details of the library, which is why I went with the DLL approach to begin with.

Do you have articles you know of i code use to better understand your code. For instance IMessageable how does this class works in the overall scheme of your framework i have many more questions.

I highly recommend you review this series of articles on getting started article with C++ and Win32. It's a good introduction and the code they present you is actually the most basic framework a lot of C++ Win32 frameworks use. For example, the techniques for managing application state greatly helped me to structure my framework, particularly around the Win32 message pump (and IMessageable).

Another resource I can recommend is theForger's Win32 API Tutorial. It's old, but much of the content is still very much relevant, and I have the tutorial code up in my own repo as well.

However, if you're keen on learning more about Win32 and prefer books, I highly recommend you get a copy of Charles Petzold's Programming Windows, 5th Edition. It's old but very much remains the de facto Bible on all things Win32 programming. I own a copy myself, and I can tell you it's absolutely invaluable and worth every cent. Like the theForger's tutorial, I also have the book's source code available.

I have alot to learn from your framework want to know the functions for some of the classes and in what situations you have run into coding something like a win32 api wrapper such as yours.

I'm happy to answer any questions you have about particular C++ classes I've created and Win32 functions I've used, what they do, and why I used them. Just ask here about the particular classes/functions you want to know about and I'll try to give an answer.

If you have any additional questions, let me know.

manuva1 commented 4 years ago

Thanks for all the help ill comb through the articles and your code in the coming weeks thanks for your quick reply.